Some i18n issues

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Some i18n issues

Fòram na Gàidhlig
I hav done some testing for my translation (Scottish Gaelic - gd) and
have come accross a few issues:

1. Is it possible to fetch the following string with ngettext:

src/gui/LevelMenu.cc:312 src/gui/LevelPackComposer.cc:348
%s: %d levels

Slavic languages will also profit from this change


2. String length issues in the credit screen (tested with a resolution
of 640 x 480 on Windows 7, Enigma 1.20):

a. Gaelic for "OK" is "Ceart ma-thà", Which is considerably longer. It
would be great if we could make this button just a little bit wider, so
the writing won't touch the edges

b. The following string gets truncated:

src/gui/MainMenu.cc:116
Please refer to the manual or the next pages for full credits.

Translation:
Thoir sùil air an leabhar-mhìneachaidh no na h-ath-dhuilleagan airson
cliùtha shlàin.

"shlàin." already appears above the navigation arrows and the . at the
end is off screen. I tried fixing this with a \n, but the renderer
apparently can't parse it.

That's all, folks, everything else seems to be working perfectly. Also,
I have reached 95% with my translation, and most of the missing strings
are the Dante + Oz levels, so I think we're ready to go adding gd to the
menus :)

_______________________________________________
Enigma-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/enigma-devel
Reply | Threaded
Open this post in threaded view
|

Re: Some i18n issues

Andreas Lochmann-2

Hi,

Am 07.07.2014 22:39, schrieb Fòram na Gàidhlig:
> I hav done some testing for my translation (Scottish Gaelic - gd) and
> have come accross a few issues:
>
> 1. Is it possible to fetch the following string with ngettext:
>
> src/gui/LevelMenu.cc:312 src/gui/LevelPackComposer.cc:348
> %s: %d levels
>
> Slavic languages will also profit from this change

I see the problem you are having (to those who
don't know about ngettext: It's about changing the
translated text depending on a number, like singular
and plural cases), but I am unaware about the scope
of the code that needs to be changed for this.
Actually, we have enough problems with the gettext-
system as it is (see missing translations on some
systems), so I suggest not to touch this for a while.
Of course, if someone is competent enough to do
this: Please call :-)

> 2. String length issues in the credit screen (tested with a resolution
> of 640 x 480 on Windows 7, Enigma 1.20):
>
> a. Gaelic for "OK" is "Ceart ma-thà", Which is considerably longer. It
> would be great if we could make this button just a little bit wider, so
> the writing won't touch the edges

This is now fixed with r2441.

> b. The following string gets truncated:
>
> src/gui/MainMenu.cc:116
> Please refer to the manual or the next pages for full credits.
>
> Translation:
> Thoir sùil air an leabhar-mhìneachaidh no na h-ath-dhuilleagan airson
> cliùtha shlàin.
>
> "shlàin." already appears above the navigation arrows and the . at the
> end is off screen. I tried fixing this with a \n, but the renderer
> apparently can't parse it.

Yes, there are more languages with the very same
problem. However, changing this would need a
new translation in all languages. To make things
worse, in 320 x 280, the screen does not fit in any
language. We will have to find a solution for this
at some point in the future; it might involve a
complete rewrite of this screen. I haven't made up
my mind about this yet.

In short: Won't fix now.


> That's all, folks, everything else seems to be working perfectly. Also,
> I have reached 95% with my translation, and most of the missing strings
> are the Dante + Oz levels, so I think we're ready to go adding gd to the
> menus :)

Your translation is now at 100%, congratulations
to you and all the other translators for your
great work, thank you!

Best regards,
Andreas



_______________________________________________
Enigma-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/enigma-devel
Reply | Threaded
Open this post in threaded view
|

Re: Some i18n issues

Fòram na Gàidhlig
> Am 07.07.2014 22:39, schrieb Fòram na Gàidhlig:
>> I hav done some testing for my translation (Scottish Gaelic - gd) and
>> have come accross a few issues:
>>
>> 1. Is it possible to fetch the following string with ngettext:
>>
>> src/gui/LevelMenu.cc:312 src/gui/LevelPackComposer.cc:348
>> %s: %d levels
>>
>> Slavic languages will also profit from this change
>
> I see the problem you are having (to those who
> don't know about ngettext: It's about changing the
> translated text depending on a number, like singular
> and plural cases), but I am unaware about the scope
> of the code that needs to be changed for this.
> Actually, we have enough problems with the gettext-
> system as it is (see missing translations on some
> systems), so I suggest not to touch this for a while.
> Of course, if someone is competent enough to do
> this: Please call :-)

I only know how it works in theory: In C++, you might need to add a
macro where you have defined the macro for _(), then make sure that the
script that creates the .pot catalogs picks it up. This is the tricky
part that I have never done myself - after that, you mark up the string
with:

sprintf(buffer,
        ngettext("%s: %d level", "%s: %d levels", level_var),
        string_var,
        level_var);

or

boost::format(ngettext("%s: %d level", "%s: %d levels", level_var))
              % string_var % level_var

For XML, I guess things will be more complicated.



>> 2. String length issues in the credit screen (tested with a resolution
>> of 640 x 480 on Windows 7, Enigma 1.20):
>>
>> a. Gaelic for "OK" is "Ceart ma-thà", Which is considerably longer. It
>> would be great if we could make this button just a little bit wider, so
>> the writing won't touch the edges
>
> This is now fixed with r2441.

Thanks!


>> b. The following string gets truncated:
>>
>> src/gui/MainMenu.cc:116
>> Please refer to the manual or the next pages for full credits.
>>
>> Translation:
>> Thoir sùil air an leabhar-mhìneachaidh no na h-ath-dhuilleagan airson
>> cliùtha shlàin.
>>
>> "shlàin." already appears above the navigation arrows and the . at the
>> end is off screen. I tried fixing this with a \n, but the renderer
>> apparently can't parse it.
>
> Yes, there are more languages with the very same
> problem. However, changing this would need a
> new translation in all languages. To make things
> worse, in 320 x 280, the screen does not fit in any
> language. We will have to find a solution for this
> at some point in the future; it might involve a
> complete rewrite of this screen. I haven't made up
> my mind about this yet.
>
> In short: Won't fix now.

We will need automatic line wrapping here. Probably tricky to implement
if you don't have a function for this in the renderer already.



>> That's all, folks, everything else seems to be working perfectly. Also,
>> I have reached 95% with my translation, and most of the missing strings
>> are the Dante + Oz levels, so I think we're ready to go adding gd to the
>> menus :)
>
> Your translation is now at 100%, congratulations
> to you and all the other translators for your
> great work, thank you!

You're welcome. Thanks for a great game!


_______________________________________________
Enigma-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/enigma-devel
Reply | Threaded
Open this post in threaded view
|

Re: Some i18n issues

Fòram na Gàidhlig
In reply to this post by Andreas Lochmann-2
> I see the problem you are having (to those who
> don't know about ngettext: It's about changing the
> translated text depending on a number, like singular
> and plural cases), but I am unaware about the scope
> of the code that needs to be changed for this.
> Actually, we have enough problems with the gettext-
> system as it is (see missing translations on some
> systems), so I suggest not to touch this for a while.
> Of course, if someone is competent enough to do
> this: Please call :-)

I just had another idea: Maybe you can "steal" some code from the
Widelands project, where we hace working ngettext in both C an Lua.

The i18n classes for C are here:

http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/files/head:/src/base/

And their script for generating the pot catalogs:

http://bazaar.launchpad.net/~widelands-dev/widelands/trunk/view/head:/utils/buildcat.py

_______________________________________________
Enigma-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/enigma-devel
Reply | Threaded
Open this post in threaded view
|

Re: Some i18n issues - code for ngettext

Fòram na Gàidhlig
Here's the line that would need to be changed in C++:

--- src/gui/LevelMenu.cc (revision 2441)
+++ src/gui/LevelMenu.cc (working copy)

@@ -312 +312 @@

-        lbl_lpinfo->set_text(ecl::strf(_("%s: %d levels"),
+        lbl_lpinfo->set_text(ecl::strf(ngettext("%s: %d level", "%s: %d
levels", size),
                 ind->getName().c_str(), size));


I don't know how to get that into the catalog though, and I also can't
test anything, because all languages just load English for me.

_______________________________________________
Enigma-devel mailing list
[hidden email]
https://lists.nongnu.org/mailman/listinfo/enigma-devel