Author Topic: Translator feedback required  (Read 21718 times)

Offline karvanit

  • Captain
  • ***
  • Posts: 94
    • View Profile
Translator feedback required
« on: November 22, 2012, 08:20:24 am »
I am attempting to create a more language-agnostic OpenXcom, by making more full sentences part of the language strings instead of building them from parts.
In the process string markers will be used, as well as plural forms.
So you have IDs like (for plural forms):
Code: [Select]
STR_DAYS_LEFT_0
No days left.
STR_DAYS_LEFT_1
Just {N} day left.
STR_DAYS_LEFT_2
Only {N} days left.

And argument substitution:
Code: [Select]
https://Engilsh (US)
STR_FAKE_craftweapon_MESSAGE_crafttype_EXAMPLE
This is a {1} for {2}.
https://Engilsh (UK)
STR_FAKE_craftweapon_MESSAGE_crafttype_EXAMPLE
Only {2} can use {1}.

Plural forms CAN be combined with argument substitution, but only like this:
Code: [Select]
STR_FAKE_crafttype_WARNING_0
No {1} in base
STR_FAKE_crafttype_WARNING_1
{N} {1} left in base
STR_FAKE_crafttype_WARNING_2
{1} in base: {N}

The plural forms work for 0 (_0) and for language  specific cases.
If the 0 case is not found, the language rules (eg plural for English, singular for French) are used.
Can the translators (or other speakers) please provide me with the different cases (number of forms and the numbers they refer to, not actual text needed)?
I currently have the rules for:
  • Czech
  • English
  • French
  • Hungarian
  • Polish
  • Romanian
  • Rusian

All other languages (now) use the English rules.
« Last Edit: November 22, 2012, 05:52:54 pm by karvanit »

Offline Fenyő

  • Colonel
  • ****
  • Posts: 423
    • View Profile
Re: Translator feedback required
« Reply #1 on: November 22, 2012, 08:57:37 am »
Can the translators (or other speakers) please provide me with the different cases (number of forms and the numbers they refer to, not actual text needed)?
I'm not sure what you are asking.
"1st, 2nd, 3rd, 4th ..."
Is this what you want in other languages?
If not, could you please be a little more specific?

Offline karvanit

  • Captain
  • ***
  • Posts: 94
    • View Profile
Re: Translator feedback required
« Reply #2 on: November 22, 2012, 09:51:33 am »
No, something more basic.
It's better to use an example:
In English, Greek and French, words can be either singular (1 of something) or plural (more than one).
English and Greek use plural for 0 as well, French uses singular.

So:
English, Greek: 2 forms, n == 1, n !=1
French: 2 forms, n < 2, n >1

So English and Greek language files would contain id strings with suffixes _0 (optional, used when n == 0), _1 (required, used when n == 1), _2 (required, used when n != 1) in the language file, while French would _0 (optional, used when n == 0), _1 (required, used when n < 2), _2 (required, used when n > 1).

 What I want is exactly these rules for other languages.

Offline kkmic

  • Commander
  • *****
  • Posts: 582
  • Undefined
    • View Profile
Re: Translator feedback required
« Reply #3 on: November 22, 2012, 10:07:38 am »
I could had helped you with Romanian, but I see the seat is taken :)

Offline Fenyő

  • Colonel
  • ****
  • Posts: 423
    • View Profile
Re: Translator feedback required
« Reply #4 on: November 22, 2012, 02:26:32 pm »
No, something more basic.
It's better to use an example:
In English, Greek and French, words can be either singular (1 of something) or plural (more than one).
English and Greek use plural for 0 as well, French uses singular.
So, like this:
0 apples.
1 apple.
2 apples.

If that's it, then it's in Hungarian:
They are all the same, SINGULAR:
0 alma.
1 alma.
2 alma.

(alma=apple, almák=apples)

BTW, why do you even bother with every language on your own?
Why not just modify the language files, appending with the thing, and let the translators "fix" the strings? (and they send it within a PR)

Offline karvanit

  • Captain
  • ***
  • Posts: 94
    • View Profile
Re: Translator feedback required
« Reply #5 on: November 22, 2012, 03:03:25 pm »
If that's it, then it's in Hungarian:
They are all the same, SINGULAR:
0 alma.
1 alma.
2 alma.

(alma=apple, almák=apples)
If you have alma and almák, then it's not all singular, is it?
I don't want the actual words, I want the different cases, as in "Sentences (nouns, verbs, whatever) will take one of X forms, where form 1 is for value A-B, form 2 for values C-F", etc.

BTW, why do you even bother with every language on your own?
Why not just modify the language files, appending with the thing, and let the translators "fix" the strings? (and they send it within a PR)

The thing requires coding support, because I implement it with looking for differently suffixed key (eg STR_1, STR_2). So I need to know how many keys, and when to use the proper suffix. Then I'll be done with basic coding support, and the hard work of replacing fragment sentence assembly with proper placeholders will begin.
Hopefully, the basic support will be accepted upstream, and we'll change the texts incrementally, perhaps after proding by translators for the worst examples (eg see post about laser rifle manufacture).

Offline radius75

  • Colonel
  • ****
  • Posts: 108
  • I am the average PC user!
    • View Profile
Re: Translator feedback required
« Reply #6 on: November 22, 2012, 03:56:41 pm »
I met with the similar solution in the UFO:AI. (.po and .pot language file)
This method is OK, gives the more possibility for translators.
I do not see any problem here :)

example from ufo:ai .po file

Quote
msgid "Scientist"
msgid_plural "Scientists"
msgstr[0] "Naukowiec"
msgstr[1] "Naukowców"
msgstr[2] "Naukowców"


msgid "Construction time:\t%i day\n"
msgid_plural "Construction time:\t%i days\n"
msgstr[0] "Czas budowy:\t%i dzień\n"
msgstr[1] "Czas budowy:\t%i dni\n"
msgstr[2] "Czas budowy:\t%i dni\n"


msgid "%s was transfered to %s."
msgstr "Przesłano %s do %s."


msgid "Recovered %s from the battlefield. UFO is being transported to %s."
msgstr "Pozyskano %s z pola bitwy. UFO jest transportowane do %s."

Offline karvanit

  • Captain
  • ***
  • Posts: 94
    • View Profile
Re: Translator feedback required
« Reply #7 on: November 22, 2012, 03:58:54 pm »
That's the idea, although the code side is closer to Qt's QTranslator.
Too bad gettext requires LOTS of additional libraries in Windows...

Offline radius75

  • Colonel
  • ****
  • Posts: 108
  • I am the average PC user!
    • View Profile
Re: Translator feedback required
« Reply #8 on: November 22, 2012, 04:10:15 pm »
or example from pioneerspacesim

Quote
JETTISONED_1T_OF_X
    Jettisoned 1 tonne of %commodity
JETTISONED_1T_OF_X
    %commodity: 1 tona wyrzucona za burtę
   
   
FUEL_SCOOP_ACTIVE_N_TONNES_H_COLLECTED
    Fuel scoop active. You now have %quantity tonnes of hydrogen.
FUEL_SCOOP_ACTIVE_N_TONNES_H_COLLECTED
    Dren paliwowy włączony. Masz %quantity ton wodoru.
   

Offline Fenyő

  • Colonel
  • ****
  • Posts: 423
    • View Profile
Re: Translator feedback required
« Reply #9 on: November 22, 2012, 04:55:22 pm »
If you have alma and almák, then it's not all singular, is it?
When used as specifying how many of them, they're all singular.
We use the plural only when no number is specified:
Examples:
There are apples on the tree.   ->   A fán almák vannak.
2 apples left.   ->   2 alma maradt.
1 apple left.   ->   1 alma maradt.
0 apples left.   ->   0 alma maradt.
There are no apples left.   ->   Nem maradt alma.

Offline karvanit

  • Captain
  • ***
  • Posts: 94
    • View Profile
Re: Translator feedback required
« Reply #10 on: November 22, 2012, 05:54:35 pm »
Thank you, now Hungarian support is also in my PR.

Offline daggerstab

  • Squaddie
  • *
  • Posts: 7
    • View Profile
    • My blog
Re: Translator feedback required
« Reply #11 on: November 24, 2012, 08:52:11 pm »
Why don't you use gettext? It has automatic support for multiple plural forms:
https://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms

It's originally a POSIX/Linux library, but it also has ports for Windows and MacOS.
https://gnuwin32.sourceforge.net/packages/gettext.htm

Offline karvanit

  • Captain
  • ***
  • Posts: 94
    • View Profile
Re: Translator feedback required
« Reply #12 on: November 24, 2012, 09:10:23 pm »
Because OpenXcom design calls for translation to be based on string IDs, not the full text.

Offline daggerstab

  • Squaddie
  • *
  • Posts: 7
    • View Profile
    • My blog
Re: Translator feedback required
« Reply #13 on: November 24, 2012, 09:18:14 pm »
Well, "you" was in the more general meaning of "the OpenXcom project", and perhaps this was the wrong place to ask. :)

Offline grzegorj

  • Captain
  • ***
  • Posts: 87
  • grzegorj and Sherlock are my nicknames...
    • View Profile
    • X-COM
Re: Translator feedback required
« Reply #14 on: January 20, 2013, 12:36:24 pm »
Karvanit, is this topic closed with no results? :)

Summing up, there is not only problem with zero. AFAIK, in order to use really correct language forms, you should use more than those three forms you have mentioned at the start. And what is used in different games, is also not correct. You have assumed incorrectly that the only possible differences are between a singular and a plural form. This is not true in languages with dual (Slovene has different forms used with 2) and with cases (most Slavic, for example) as various case forms may be used with such or another numeral. As a Polish native speaker who know also Russian enough well, I can share my observations with you.

Let's take units and soldiers. In order to make fully correct forms, we should have at least the following variants:
  • 0 sztuk, żołnierzy
  • 1 sztuka, żołnierz
  • 2, 3, 4; 22, 23, 24; 32 ... 94 sztuki, żołnierzy
  • 5-20, 25-30, 35-40, ... 95-100 sztuk, żołnierzy
  • 21, 31, ... 91 sztuk, żołnierzy
so at minimum 5 different variants. The list of 5 different forms is going to be universal for now (and not only Polish-oriented) but it is quite possible that would not be enough when we added Slovene which uses separate dual forms.

I have separated 21, 31, 41 ... from 5, 6, 7 etc., taking Russian under consideration: in that language numerals 21, 31, ... 91 behave just like 1 (so with singular, not like in Polish). Be aware of 11, 12, 13 and 14 - they behave differently than 21, 22, 23 and 24 (in both Polish and Russian).

However... as you can see, there are words used in 3 different forms (sztuka : sztuki : sztuk) and words with only two forms (żołnierz : żołnierzy). As now, STR_DAY_1, STR_DAY_2, STR_DAY_3 are enough for fully correct Polish - as "day" has only 2 forms here. But it is still not enough for Russian! - as I can see in the language file, now the "general plural" form is used there - but this form is, frankly speaking, incorrect to use with any numeral ({N} Дни instead of 0 дней, 2-4 дня, 5-20 дней, 21 день, 22-24 дня, 25-30 дней and so on, with only 1 день fully correct).

Which is more, if you want to translate "Units: {N}", you do not need numerous forms, as one general form may be used with all quantities. However, in order to translate "{N} units" correctly, you will have to use those 5 listed above, universal different strings.

Reassuming: I do not think there is a need for creating many different variants for every string with a quantity. Perhaps you should rely on translators' requests, and when there is such a need, make variants of a given string only, as many as needed.