Welcome
Welcome to refracta

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!

refractainstaller locale correspondence

Refracta Development, Scripts, etc.

refractainstaller locale correspondence

Postby balloon » Thu Jan 19, 2017 11:06 am

I want refractainstall to be added locale.

Desktop environments such as Xfce can accommodate locales,
but some users exclude use by English installer.

I want Refracta Japanese ISO. It can be realized using refractasnapshot.
but current installer is a problem.
BALLOON a.k.a. Fu-sen. | 日本語情報 https://installlinux.jimdo.com/linux-%E ... /refracta/
User avatar
balloon
 
Posts: 15
Joined: Sat Nov 05, 2016 9:36 am
Location: Japan

Re: refractainstaller locale correspondence

Postby fsmithred » Thu Jan 19, 2017 4:02 pm

I don't know how to do that, but I think dzz does know. Exegnulinux can use Spanish in the installer. If he doesn't see this and answer, I'll try to track him down.
User avatar
fsmithred
 
Posts: 2081
Joined: Wed Mar 09, 2011 9:13 pm

Re: refractainstaller locale correspondence

Postby dzz » Fri Jan 20, 2017 2:55 am

Basically, a text dialog line in a script with "$" in front of it (refractainstaller mostly has already) is automatically translated to the current locale, if the translation files exist. No other changes to the scripts are necessary.

The translator (thanks in advance, ballon!) will need to write and process the pot, po and mo files (containing the translations) and maintain them as and when the scripts update. There are gui utilities to help..

A basic understanding of "gnu gettext" is first needed. Start with installing "info" then read "info gettext".
dzz
 
Posts: 647
Joined: Wed Apr 27, 2011 11:53 am
Location: Devon, England

Re: refractainstaller locale correspondence

Postby balloon » Fri Jan 20, 2017 6:02 am

Thanks fsmithred and dzz. :D Exe is also on my PC, too. ;)

I know refractainstaller is made of Shell.
Probably there is no need to greatly improve the source.

Probably this response will be to adopt refractainstaller in other distributions.
Of course it is also useful for Refracta. :mrgreen:

We can correspond refractasnapshot as well.
BALLOON a.k.a. Fu-sen. | 日本語情報 https://installlinux.jimdo.com/linux-%E ... /refracta/
User avatar
balloon
 
Posts: 15
Joined: Sat Nov 05, 2016 9:36 am
Location: Japan

Re: refractainstaller locale correspondence

Postby fsmithred » Sun Jan 22, 2017 12:27 pm

It looks like the translations depend on a PO file, which contains the line number from the script, the untranslated text and the translated text. So, what I need to know is how I can screw that up. If I change the script by inserting or removing a line, does someone have to go and change all the line numbers in the PO file? Also, if I change the wording in a line of text, and the PO file does not get changed, does it still show the old translation for that line?
User avatar
fsmithred
 
Posts: 2081
Joined: Wed Mar 09, 2011 9:13 pm

Re: refractainstaller locale correspondence

Postby balloon » Sun Jan 22, 2017 2:07 pm

Usually it is handled per sentence.
If there is no change in the original sentence, translation will be maintained even if the source changes.
If the original sentence changes, it will be untranslated, and there will be many times to re-translate it again.
In that case, if not translated, the sentence will be returned to English. (Still it will be displayed)

These may vary depending on the system used.
Applications such as poedit are common for translation work.
Recently we can translate work on the web as well.
BALLOON a.k.a. Fu-sen. | 日本語情報 https://installlinux.jimdo.com/linux-%E ... /refracta/
User avatar
balloon
 
Posts: 15
Joined: Sat Nov 05, 2016 9:36 am
Location: Japan

Re: refractainstaller locale correspondence

Postby dzz » Sun Jan 22, 2017 9:18 pm

In the latest refractainstaller-yad script I found only 2 instances of a missing "$" before a text dialog. Far as I remember that was done a while back, to facilitate future translations. The yad "button" text would need sorting similarly. A script header, something like this, is probably needed:

Code: Select all
TEXTDOMAIN=refractainstaller-gui
TEXTDOMAINDIR=/usr/share/locale/


Apart from that, the rest is the translator's job. There are around 150 strings to translate. I don't know how or if the configuration file should be done.

The cli script needs all the "echo" strings marked.

I used poedit before but mostly preferred the cli commands. This one dumps the marked strings to a template file:

Code: Select all
bash --dump-po-strings /usr/bin/refractainstaller-yad >refractainstaller-gui.pot


You can open and edit it (better, a copy of) with a normal text editor or poedit. You then convert to the binary "*.mo" file which goes in e.g. /usr/share/locale/ja/LC_MESSAGES/ (could be in the main .deb, or packaged separately)

I only really know this stuff to an elementary level. I could maybe help more in a European language but don't even know the Japanese alphabet! However, balloon seems to be on the case already.
dzz
 
Posts: 647
Joined: Wed Apr 27, 2011 11:53 am
Location: Devon, England

Re: refractainstaller locale correspondence

Postby balloon » Mon Jan 23, 2017 2:18 am

I can provide Japanese .po files from .pot files. Of course it is also possible to check the display.
Should I try to generate a .pot file in addition to the source?
BALLOON a.k.a. Fu-sen. | 日本語情報 https://installlinux.jimdo.com/linux-%E ... /refracta/
User avatar
balloon
 
Posts: 15
Joined: Sat Nov 05, 2016 9:36 am
Location: Japan

Re: refractainstaller locale correspondence

Postby dzz » Mon Jan 23, 2017 12:44 pm

Should I try to generate a .pot file in addition to the source?

Yes, at this stage. The .pot is your "template", copy that as a .po and edit that. Work on a copy of the script (the official version isn't quite ready yet) with the header included near the top, as I posted earlier.

When you save the .po using poedit, it automatically generates the binary ".mo", which you can copy manually to the right place, for local testing.

Note: Get your .pot sorted and verified first. Your initial .pot will have problems with duplicate strings. I found a text editor easier than poedit to sort that. That is then the template for all other translations.

Good luck ballon and be prepared for a little rage during the learning curve!
dzz
 
Posts: 647
Joined: Wed Apr 27, 2011 11:53 am
Location: Devon, England

Re: refractainstaller locale correspondence

Postby balloon » Tue Jan 24, 2017 1:59 am

I tried it.

I have generated a pot file using xgettext:
Code: Select all
xgettext -L shell -o refractainstaller.pot refractainstaller-yad

I translated some sentences with poedit from there:
Image

I added the code described by dzz to refractainstaller-yad. (I changed the path for testing)

as a result, Refractainstaller replaced me with Japanese display unexpectedly:
Image

I can translate the tool with this. Thanks dzz! :D
It seems easy to realize.
BALLOON a.k.a. Fu-sen. | 日本語情報 https://installlinux.jimdo.com/linux-%E ... /refracta/
User avatar
balloon
 
Posts: 15
Joined: Sat Nov 05, 2016 9:36 am
Location: Japan

Next

Return to Discuss

Who is online

Users browsing this forum: No registered users and 1 guest

cron
suspicion-preferred