Skip to content

Gettext internationalization#1

Open
sfs-pra wants to merge 7 commits intozipproth:fix-kanshi-output-namesfrom
sfs-pra:fix-kanshi-output-names
Open

Gettext internationalization#1
sfs-pra wants to merge 7 commits intozipproth:fix-kanshi-output-namesfrom
sfs-pra:fix-kanshi-output-names

Conversation

@sfs-pra
Copy link
Copy Markdown

@sfs-pra sfs-pra commented Jul 8, 2025

[1.1.2] - 2025-07-08

Added

Gettext internationalization.
ru.po
Internationalization in network.cycles.wdisplays.desktop
https://aur.archlinux.org/cgit/aur.git/tree/outputs_noop.patch?h=wdisplays-persistent

Fixed

setlocale(LC_NUMERIC, "C") in src/store.c

zipproth pushed a commit that referenced this pull request Jul 8, 2025
* wip

* Fix deprecated flag

* check config path only on startup

* use HEADS_MAX from wdisplays.h

* remove useless strcpy

* update readme and meson syntax

* clang-format

* Fix C23 issues

gcc 15 is more strict and compiles C by default with C23.  `noop` is
used as a default null initializer, but now it must have the correct
type, so add a cast.

See also: https://bugs.gentoo.org/946954

---------

Co-authored-by: Viorel Munteanu <ceamac@gentoo.org>
@zipproth
Copy link
Copy Markdown
Owner

zipproth commented Jul 8, 2025

Thank you very much for taking the time to add internationalisation support – it’s a sizeable amount of work and definitely useful for the project.

For the moment, however, this branch (fix-kanshi-output-names) is deliberately limited to the Kanshi-compatibility fix that I am proposing upstream ( petertheprocess#2 ). Merging unrelated features here would make that review harder and would mix very different topics in one changeset.

Could you please open a new pull request directly against petertheprocess/wdisplays (master) with your i18n commits? That way the maintainer – and the wider user base – can review and discuss the translations, gettext integration and desktop-file changes in one dedicated place.

I’ll gladly keep an eye on that PR and, once it is accepted upstream, pull the changes into my AUR package (wdisplays-persistent). Until then I need to keep this fork focused on the single Kanshi bug-fix so that the histories stay clean and easy to follow.

Thanks again for the contribution and for understanding!

— Stefan

@sfs-pra
Copy link
Copy Markdown
Author

sfs-pra commented Jul 9, 2025

Could you please open a new pull request directly against petertheprocess/wdisplays (master) with your i18n commits?

OK. I'll do it in the next few days

@sfs-pra
Copy link
Copy Markdown
Author

sfs-pra commented Jul 9, 2025

d5f0e48 - norm. The more recent ones don't work. Should I make a gettext of this commit?

25211d7 - does not compile
4455950 - does not compile

[29/32] Compiling C object src/wdisplays.p/store.c.o
../wdisplays-25211d7327c95748775f41017f78a92245f53c7e/src/store.c: В функции «wd_get_config_file_path»:
../wdisplays-25211d7327c95748775f41017f78a92245f53c7e/src/store.c:47:59: предупреждение: «/kanshi/config» директивный вывод может быть усечен записью 14 байт в область размера от 1 до 4096 [-Wformat-truncation=]
   47 |   snprintf(kanshiConfigPath, sizeof(kanshiConfigPath), "%s/kanshi/config", defaultConfigDir);
      |                                                           ^~~~~~~~~~~~~~
In file included from /usr/include/stdio.h:970,
                 from /usr/include/pango-1.0/pango/pango-utils.h:25,
                 from /usr/include/pango-1.0/pango/pango.h:51,
                 from /usr/include/gtk-3.0/gdk/gdktypes.h:35,
                 from /usr/include/gtk-3.0/gdk/gdkapplaunchcontext.h:30,
                 from /usr/include/gtk-3.0/gdk/gdk.h:32,
                 from /usr/include/gtk-3.0/gtk/gtk.h:30,
                 from ../wdisplays-25211d7327c95748775f41017f78a92245f53c7e/src/headform.h:7,
                 from ../wdisplays-25211d7327c95748775f41017f78a92245f53c7e/src/wdisplays.h:23,
                 from ../wdisplays-25211d7327c95748775f41017f78a92245f53c7e/src/store.c:5:
В функции «snprintf»,
    включённом из «wd_get_config_file_path» в ../wdisplays-25211d7327c95748775f41017f78a92245f53c7e/src/store.c:47:3:
/usr/include/bits/stdio2.h:68:10: замечание: «__builtin___snprintf_chk» вывод от 15 до 4110 байт в приемник размера 4096
   68 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   69 |                                    __glibc_objsize (__s), __fmt,
      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   70 |                                    __va_arg_pack ());
      |                                    ~~~~~~~~~~~~~~~~~
../wdisplays-25211d7327c95748775f41017f78a92245f53c7e/src/store.c: В функции «wd_get_config_file_path»:
../wdisplays-25211d7327c95748775f41017f78a92245f53c7e/src/store.c:50:53: предупреждение: «/wdisplays.conf» директивный вывод может быть усечен записью 15 байт в область размера от 1 до 4096 [-Wformat-truncation=]
   50 |   snprintf(wdisplaysPath, sizeof(wdisplaysPath), "%s/wdisplays.conf", defaultConfigDir);
      |                                                     ^~~~~~~~~~~~~~~
В функции «snprintf»,
    включённом из «wd_get_config_file_path» в ../wdisplays-25211d7327c95748775f41017f78a92245f53c7e/src/store.c:50:3:
/usr/include/bits/stdio2.h:68:10: замечание: «__builtin___snprintf_chk» вывод от 16 до 4111 байт в приемник размера 4096
   68 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   69 |                                    __glibc_objsize (__s), __fmt,
      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   70 |                                    __va_arg_pack ());
      |                                    ~~~~~~~~~~~~~~~~~
../wdisplays-25211d7327c95748775f41017f78a92245f53c7e/src/store.c: В функции «wd_get_config_file_path»:
../wdisplays-25211d7327c95748775f41017f78a92245f53c7e/src/store.c:85:32: предупреждение: «__builtin_strncpy» specified bound 4096 equals destination size [-Wstringop-truncation]
   85 |     if (envKanshiConf != NULL) strncpy(kanshiConfigPath, envKanshiConf, sizeof(kanshiConfigPath));
      |                                ^
[32/32] Linking target src/wdisplays
FAILED: src/wdisplays 
cc  -o src/wdisplays src/wdisplays.p/meson-generated_.._.._resources_wdisplays-resources.c.o src/wdisplays.p/main.c.o src/wdisplays.p/glviewport.c.o src/wdisplays.p/headform.c.o src/wdisplays.p/outputs.c.o src/wdisplays.p/overlay.c.o src/wdisplays.p/render.c.o src/wdisplays.p/store.c.o -Wl,--as-needed -Wl,--no-undefined -pie -Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wl,--start-group protocol/libclient_protos.a -lm -lrt /usr/lib/libwayland-client.so /usr/lib/libepoxy.so /usr/lib/libgtk-3.so /usr/lib/libgdk-3.so /usr/lib/libz.so /usr/lib/libpangocairo-1.0.so /usr/lib/libpango-1.0.so /usr/lib/libharfbuzz.so /usr/lib/libatk-1.0.so /usr/lib/libcairo-gobject.so /usr/lib/libcairo.so /usr/lib/libgdk_pixbuf-2.0.so /usr/lib/libgio-2.0.so /usr/lib/libgobject-2.0.so /usr/lib/libglib-2.0.so -Wl,--end-group
/usr/bin/ld: src/wdisplays.p/outputs.c.o: в функции «config_handle_succeeded»:
outputs.c:(.text+0x97): undefined reference to `store_config'
/usr/bin/ld: src/wdisplays.p/store.c.o: в функции «wd_store_config»:
store.c:(.text+0x668): undefined reference to `wd_get_kanshi_config'
collect2: ошибка: выполнение ld завершилось с кодом возврата 1
ninja: build stopped: subcommand failed.

zipproth pushed a commit that referenced this pull request Jan 22, 2026
* check config path only on startup

* use HEADS_MAX from wdisplays.h

* remove useless strcpy

* update readme and meson syntax

* clang-format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants