On Mon, Sep 11, 2017 at 1:57 AM, mkpoli <snowwolf1...@gmail.com> wrote:

>
> Paul Licameli <paul.licam...@gmail.com>于2017年9月11日周一 上午12:10写道:
>
>> On Sun, Sep 10, 2017 at 6:26 AM, mkpoli <snowwolf1...@gmail.com> wrote:
>>
>>> I checked a lot of files including GB (Chinese National Standardization)
>>> and some other rules.
>>>
>>> I recommend format "%{h}d 时 %{m}d 分", which means:
>>>
>>> 1 hour -> 1 时
>>> %d hours -> %d 时
>>> 1 minute -> 2 分
>>> %d minutes -> %d 分
>>>
>>>
>>> Further Reading:
>>> -------------------------------------------------------
>>> In modern Chinese language, it's extremely free to express a time:
>>>
>>> Time with both hours and minutes: there is no need for classifier.
>>> Time with only hours: classifier is optional.
>>>
>>> e.g. ( [] for optional)
>>> 1. (ENG) 1 hour and 2 minutes = (CHN) 一小时两分钟 = (Literally) One Hour
>>> Liang(=Two) Minute = (Writing CHN) 2 时 2 分 .
>>> 2. (ENG) 1 hour = (CHN) 一[个]小时 = (Literally) One [Ge(classifier)] Hour.
>>> 3. (ENG) 2 hours = (CHN) 两[个]小时 = (Literally) Liang(=Two)
>>> [Ge(classifier)] Hour.
>>>
>>> Two hours and two minutes can be translated as:
>>> 2 时 2 分  (Writing)
>>> 两小时两分钟 (Oral, not best if written down)
>>> -------------------------------------------------------
>>>
>>
>> Thanks.
>>
>> I don't know if %{h}d is accepted by wxString formatting -- I must
>> research that.
>>
>
> Just for examples, like %{1}d %{2}d or whatever. As far as I know,
> translating system using POTs and POs can support formatting rearrangment.
>
>
>> Time expressions are indeed one example of locale dependency, and again,
>> this bit of code, that pieces two phrases together with the format "%d %s
>> and %d %s.", shows more bad English grammar bias.
>>
>
>> But aside from special expressions for time -- I was concerned about a
>> more general point about plurals: It's bad for us to ask that you translate
>> single words out of context like "track" and "tracks".
>>
>
>> Rather, at least, "1 track" and "%d tracks".  Do you agree that the
>> proper Chinese would use classifiers in that context, but you would not
>> know that you should do that for "track" or "tracks" in isolation.
>>
>> And, as we have learned, Basque would need to put the numeral 1 after the
>> noun but other numerals before.  Thus, I should give the Basque translator
>> "%d tracks" (or hours) and not just "tracks".
>>
>
> Yes. And I think "%d %s and %d %s." is worse than "1 hour and 1 minute" +
> "1 hour and %d minutes" + "%d hours and 1 minute" + "%d hours and %d
> minutes". That's a way to do it, but I'm not sure if there is a better way
> for compatibility in the wxString stuff.
>

It would not work well that way:  let's understand why I learned about
wxPLURAL and want to generate msgid_plural directives in the .po files.

The correct number of alternatives for one number + noun phrase, is two for
English, so you suggest I make 2 x 2 = 4 alternative format strings.
Chinese would only need one common translation for the four, if I made %d
everywhere and substituted 1 with printf.

But some languages like Ukrainian require more than two forms.  Should I
make nine format strings to accommodate them?  Or sixteen, or larger
squares?  You see this doesn't scale.

No: if I really want this string, combining two noun phrases, each with an
independent number -- then the manageble thing is to translate each
separately, using wxPLURAL which takes an English singular-plural string
pair but corresponds to a language-appropriate list of one, two, or more
strings.  Then combine the two translations by substituting into a third
format string.

This third, combining format string should take whole quantified phrases as
single %s directives; the %d occur not in it, but in the formats for each
phrase.

PRL



>
> For a language's morphology without plural - singular difference, I can
> translate them as the same.  ("1 时 1 分" + "1 时 %d 分" + ...)
>
> Yes, "1 track" -> “1 个轨道” = 1 + Ge (classifier) + Track, "%d tracks" ->
> "%d 个轨道" = %d + Ge (classifier) + Track. But I can just treat them as the
> same (“1 个轨道” + "%d 个轨道").
>
> Ok. Same thing as I said before.
>
>
>>
>>
> Other languages surely have their own complications too.  Some languages
>> may even need more than two number forms.  Thanks to Yuri's hints, I have
>> educated myself some more in how xgettext does indeed accommodate such
>> languages.
>>
>> This particular example of times is a phrase which, in English, contains
>> not one but two parts that can independently vary into singular or plural
>> -- and this presents extra difficulty for proper internationalization!
>>
>> The "%d %s and %d %s." at least is accompanied by /* i18n-hint: A time in
>> hours and minutes. Only translate the "and". */
>>
>> But now I think it would be better first to translate "1 hour" or "%d
>> hours", likewise the minutes, and then substitute into "%s and %s", with a
>> comment about the purpose of that format.
>>
>
> I think so. That is equivalent as result to my idea.
>
>
>>
>> And furthermore there are optional "contexts" for gettext, and likely "%s
>> and %s" should have a context connected to it.
>>
>> (And "context" might also let us translate light-as-not-dark distinctly
>> from light-as-not-heavy, if ever that is really needed.)
>>
>> PRL
>>
>>
>>
>>>
>>> Paul Licameli <paul.licam...@gmail.com>于2017年9月10日周日 上午1:25写道:
>>>
>>>> From what little I know of languages, this question goes especially to
>>>> Chinese and Russian translators, but maybe it is also relevant to other
>>>> languages I know less about.
>>>>
>>>> I found a small gap in our translations.  See the code below.  "hour",
>>>> "hours", "minute", "minutes" did not get extracted to the .pot file.  The
>>>> intention is to compose strings like "1 hour and 2 minutes" from
>>>> translations of pieces of the phrase.
>>>>
>>>> But I think it is better not to fix it by giving you four more little
>>>> words to translate.  Rather, give a little more context.  That is, make the
>>>> pieces to translate a little bigger:
>>>>
>>>> 1 hour
>>>> %d hours
>>>> 1 minute
>>>> %d minutes
>>>>
>>>> I am thinking, for instance, that good Chinese requires a "classifier"
>>>> word before "hours" or "minutes" -- but if I ask the Chinese translator
>>>> just for the word "hour" or "hours" out of context, I would be given a
>>>> translation without a classifier, and then assembling the pieces would not
>>>> be good Chinese.
>>>>
>>>>    // Use wxPLURAL to get strings
>>>>
>>>>    sHours = wxPLURAL("hour", "hours", iHours);
>>>>
>>>>    sMins = wxPLURAL("minute", "minutes", iMins);
>>>>
>>>>
>>>>    /* i18n-hint: A time in hours and minutes. Only translate the
>>>> "and". */
>>>>
>>>>    sFormatted.Printf(_("%d %s and %d %s."), iHours, sHours, iMins,
>>>> sMins);
>>>>
>>>>    return sFormatted;
>>>>
>>>> Below is another example of a translated phrase assembled from pieces,
>>>> but without regard to other grammars.  The word "of" with no context is a
>>>> very poor thing to present to translators.  Better in this case, I think,
>>>> that the strings be
>>>>
>>>> 1 of 1 clip
>>>> %d of %d clips
>>>>
>>>> (and really the first isn't good English, perhaps it should be "sole
>>>> clip")
>>>>
>>>> I am thinking of a language like Russian where "clips" above would
>>>> properly be translated into genitive plural case, but "clips" without
>>>> context is again a bad thing to present to the translator.  The translator
>>>> would probably give me nominative plural when there is no context.
>>>>
>>>>          wxString temp;
>>>>
>>>>          temp.Printf(wxT("%d %s %d %s "), result.index + 1, _("of"),
>>>> result.waveTrack->GetNumClips(),
>>>>
>>>>             result.waveTrack->GetNumClips() == 1 ? _("clip") : _(
>>>> "clips"));
>>>>
>>>>          message += temp;
>>>>
>>>> Translators, can you name other examples like this?  Are there other
>>>> examples of English strings in the .pot file that are single words out of
>>>> context, which gave you doubts and difficulties about the right answers?
>>>>
>>>> Paul Licameli
>>>>
>>>> ------------------------------------------------------------
>>>> ------------------
>>>> Check out the vibrant tech community on one of the world's most
>>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot______
>>>> _________________________________________
>>>> Audacity-translation mailing list
>>>> Audacity-translation@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/audacity-translation
>>>>
>>>
>>> ------------------------------------------------------------
>>> ------------------
>>> Check out the vibrant tech community on one of the world's most
>>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
>>> _______________________________________________
>>> Audacity-translation mailing list
>>> Audacity-translation@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/audacity-translation
>>>
>>> ------------------------------------------------------------
>> ------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, Slashdot.org! http://sdm.link/slashdot______
>> _________________________________________
>> Audacity-translation mailing list
>> Audacity-translation@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/audacity-translation
>>
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Audacity-translation mailing list
> Audacity-translation@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/audacity-translation
>
>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Audacity-translation mailing list
Audacity-translation@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/audacity-translation

Reply via email to