Closed Pro-pra closed 1 year ago
after add .mo file, characters in menu non-readable :(
How do you generate the .pot
file?
How to you generate the .po
file(s)?
How to you generate the .mo
file(s)?
Up to now I used a generated Makefile to call the correct "magic" commands.
@Pro-pra I got no answer fro you. I am OK to add internationalisation and localosation. But I need your help.
Hi, sorry, i forgot add Makefile to po dir it`s based on example from https://github.com/gflohr/libintl-perl/blob/master/sample/simplecal/po/Makefile
Thanks for the Makefile. I am now able to get a French l10n of scriptor. Nice.
I get the same problem as you for Russian. It looks like the UTFè8 encoding has an issue.
You can test using the branch i18n
from https://github.com/LudovicRousseau/pcsc-tools-debug/tree/i18n
I also note that I have no problem with scriptor
(command line in the console) in French or Russian.
But I can't correctly display French accents in gscriptor. Maybe it is a problem between Perl and Gtk+.
Add
use utf8;
not help me for enable utf8 support, need check docs for perl-gtk3 may be
https://wiki.gnome.org/Projects/GTK-Perl/ say "unicode support already present"
I tried adding accented letters in https://github.com/LudovicRousseau/pcsc-tools/blob/master/gscriptor#L183 and I have the problem (even without your modifications).
I need to add:
use utf8;
This is expected since, in this case, the script contains utf8 characters so I must indicate it to Perl.
But if I use the __()
construction the text is wrong again in the Gtk interface. Even for the original English version.
If I use print(__("_File") . "\n");
I get the correct text (including accents) in the console. So the function __()
works as expected.
Not idea what the problem is.
hmmm.... libintl unicode support need check.... may be https://github.com/gflohr/libintl-perl/ this project have answer for this?
I am not sure the problem is with libintl-perl. I used this patch:
diff --git a/gscriptor b/gscriptor
index b4a9db5..46a107f 100755
--- a/gscriptor
+++ b/gscriptor
@@ -205,6 +205,7 @@ sub arrange_widgets () {
[ "About", undef, __("_About"), "<control>A", __("About"), \&About ],
);
+ print __("_File") . "\n";
my $ui = Gtk3::UIManager->new();
my $action_group = Gtk3::ActionGroup->new('AppWindowActions');
$action_group->add_actions( \@appActions, undef );
diff --git a/po/fr.po b/po/fr.po
index 2c2ca28..52ca83b 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -18,7 +18,7 @@ msgstr ""
#: ../gscriptor:188
msgid "_File"
-msgstr ""
+msgstr "Fichier àç"
#: ../gscriptor:189
msgid "_New"
And I correctly get the output Fichier àç
in the console.
So the function __()
works as expected.
With LANG=ru_RU.UTF-8
I get i the console _Файл
.
work in console not work in gtk3 window hmmm....
It works now. I updated my i18n branch at https://github.com/LudovicRousseau/pcsc-tools-debug/commits/i18n
The next step: how/where to install the .mo
files so that perl can find them automatically?
Cool!!!
XDG standard path: ex. /usr/share/locale/ru/LC_MESSAGES/pcsc-tools.mo
may be "make install" from ./po directory install all locales to right path?
Not sure about this path.
It looks like Perl is looking for a LocaleData
directory in these places:
/etc/perl/LocaleData
/usr/lib/x86_64-linux-gnu/perl/5.36/LocaleData
/usr/lib/x86_64-linux-gnu/perl5/5.36/LocaleData
/usr/lib/x86_64-linux-gnu/perl-base/LocaleData
/usr/local/lib/site_perl/LocaleData
/usr/local/lib/x86_64-linux-gnu/perl/5.36.0/LocaleData
/usr/local/share/perl/5.36.0/LocaleData
/usr/share/perl/5.36/LocaleData
/usr/share/perl5/LocaleData
I am not sure which one to use. On my Debian system none of them exist already.
i put locale to /usr/share/locale/ru/LC_MESSAGES and its works fine.
libintl and gettext and msgfmt utils work with /usr/share/locale/*
I updated https://github.com/LudovicRousseau/pcsc-tools-debug/tree/i18n
Now you can use the classic:
./configure
make
sudo make install
Please test on your side and tell me if it works (or not) for you.
$ LANG=C make -f Makefile.intl update-po
cat: /POTFILES: No such file or directory
make pcsc-tools.pot
make[1]: Entering directory '/home/rosa/tmp/pcsc-tools-debug-i18n/po'
make[1]: Nothing to be done for 'pcsc-tools.pot'.
make[1]: Leaving directory '/home/rosa/tmp/pcsc-tools-debug-i18n/po'
cd ; \
catalogs='ru fr'; \
for cat in $catalogs; do \
cat=`basename $cat`; \
lang=`echo $cat | sed 's/\.po$//'`; \
mv $lang.po $lang.old.po; \
echo "$lang:"; \
if msgmerge $lang.old.po pcsc-tools.pot -o $lang.po; then \
rm -f $lang.old.po; \
else \
echo "msgmerge for $cat failed!"; \
rm -f $lang.po; \
mv $lang.old.po $lang.po; \
fi; \
done
mv: cannot stat 'ru.po': No such file or directory
ru:
msgmerge: error while opening "ru.old.po" for reading: No such file or directory
msgmerge for ru failed!
mv: cannot stat 'ru.old.po': No such file or directory
mv: cannot stat 'fr.po': No such file or directory
fr:
msgmerge: error while opening "fr.old.po" for reading: No such file or directory
msgmerge for fr failed!
mv: cannot stat 'fr.old.po': No such file or directory
make: *** [Makefile.intl:79: update-po] Error 1
$(srcdir) needed
I pushed a new commit.
You need to first run ./bootstrap
at least once. Then ./configure
.
may be need more simple way for work with translations? i need "make update-po" and not need compile programm for this.
We can discuss about complexity if you want.
My question was: do you get the Russian translation after the commands:
./configure
make
sudo make install
Yes, work good. see screenshot:
Some messages untranslated: scriptor --help see therminal screen Wrap lines Run Script Result Welcome to the gscriptor application!
also we have icons pack for desktop file: icons.tar.gz and add to desktop file: Icon=gscriptor
Under what license do you provide the icon?
GPL, we use this icons from 2019 year.
Icon added. I also i18n more strings. Please update the ru.po file.
I have error:
$ gscriptor
String found where operator expected at /usr/bin/gscriptor line 255, near "# The ""
(Missing semicolon on previous line?)
String found where operator expected at /usr/bin/gscriptor line 255, near "my $txtReader = Gtk3::Label->new (__(""
(Missing semicolon on previous line?)
May be you add this localization patch for desktop file? (fr localization also needed)
--- pcsc-tools-1.5.4/gscriptor.desktop 2016-03-20 01:36:46.000000000 +0300
+++ pcsc-tools-1.5.4_patched/gscriptor.desktop 2019-11-12 10:28:22.470791937 +0300
@@ -1,7 +1,9 @@
[Desktop Entry]
Name=Gscriptor
Comment=Send commands to smart cards
+Comment[ru]=Отправка команд на смарт-карты
Exec=gscriptor
gscriptor
problem fixed. Sorry.
I also added l10n for the .desktop
file.
Where can I see the Comment field displayed?
if icons now in /usr/share/icons need set Icons=pcsc-tools in pcsc-tools.desktop.in
Commend field display fine. Screenshot gscriptor with ru lang attached.
I think this is good work, and need new release.
if icons now in /usr/share/icons need set Icons=pcsc-tools in pcsc-tools.desktop.in
There is no pcsc-tools.desktop.in
file.
Icon=
is already in https://github.com/LudovicRousseau/pcsc-tools-debug/blob/i18n/gscriptor.desktop.in#L11
I don't understand what you are talking about here.
Yes, a new release is planned. I am waiting for your "go".
sorry, gscriptor.desktop.in
if icons now in /usr/share/icons need set Icon=gscriptor
Yes, a new release is planned. I am waiting for your "go".
see my screenshot, field Script and Result untranslated, button "Run" and "wrap lines" its not critical and may be translated after release
New i18n strings.
Please provide an updated ru.po
file.
What do you use gscriptor for? since how long?
Updated ru.po attached.
What do you use gscriptor for? since how long?
They gave me a PC with a Baikal processor. It comes with a keyboard with a built-in smart card reader.
pcsc-tools is included with many distributions.
See, looks fine!
ru.po
updated. Thanks.
I understand that you have a smart card reader. My questions are:
why do you use gscriptor?
AltLinux Workstation 10.1 have it in-box. AltLinux Workstation installed to PC with Baikal.
what do you use your smart card for?
I don't have writable smart cards yet. We just read the currently existing smart cards for testing.
why not another program?
I don't know about them.
what do you like in gscriptor?
I'm the maintainer of the Rosa linux distribution, I package a lot of software and help developers make software easy to install.
I merged the code. Thanks
The next step is to make a new release of pcsc-tools.
Have nice day! I tried to add localization using libintl-perl
.pot file generated, on some string i have errors ex.: ../scriptor:47: invalid variable interpolation at "$"