ualbertalib / DMPonline_v4

New code for DMPonline developed by DCC
dmponline.dcc.ac.uk
GNU Affero General Public License v3.0
4 stars 30 forks source link

i18n: feedback for answered questions isn't showing in the right language or is partially translated #40

Closed mhvezina closed 9 years ago

mhvezina commented 9 years ago

French interface. The following must be translated and/or the English version is triggered instead of the French one: dmpbuilder_answeringquestions_feedbacktimeinfonottranslated

This one is partially translated:

dmpbuilder_answeringquestions_feedbacktimeinfopartiallytranslated

It should be "Réponse faite par (name) il y a 2 minutes" and "Réponse faite par (name), il y a moins d'une minute"

weiweishi commented 9 years ago

I need a little bit help in making the translation properly.

With simple translation in fr.yml file here: answered_by: "Réponse faite par " answered_by_part2: " de "

This message is translated as: Réponse faite par about an hour ago de DMP Administrator

This certainly is not right.

The javascript is in control of transforming current timestamp into the time string as in following: prefixAgo: null, prefixFromNow: null, suffixAgo: "ago", suffixFromNow: "from now", seconds: "less than a minute", minute: "about a minute", minutes: "%d minutes", hour: "about an hour", hours: "about %d hours", day: "a day", days: "%d days", month: "about a month", months: "%d months", year: "about a year", years: "%d years", wordSeparator: " ", numbers: []

Could you please translate the strings and let me know what is the right order in French for this phrase to make sense?

mhvezina commented 9 years ago

are those variables (both *.yml and javascript) used elsewhere or for other purposes?

weiweishi commented 9 years ago

Hi Marie Helene

No. They are used only for this purpose. So we can modify it as we need.

Weiwei Shi

Digital Initiative Applications Librarian University of Alberta Libraries 2-10L Cameron Library Edmonton, Alberta, Canada T6G 2J8 Phone:(780)492-7802 Fax: (780)248-1209 Email: weiwei.shi@ualberta.ca

On Thu, Sep 3, 2015 at 10:51 AM, Marie-Hélène Vézina < notifications@github.com> wrote:

are those variables (both *.yml and javascript) used elsewhere or for other purposes?

— Reply to this email directly or view it on GitHub https://github.com/ualbertalib/DMPonline_v4/issues/40#issuecomment-137509060 .

mhvezina commented 9 years ago

Ok, so the syntax (elements order) is different for both languages. Knowing now that those variables are only used in this context (i.e. feedback for question answered), I would say that we have 2 options here. Option # 1 is quick and easy. Option # 2 would be more elegant and accurate I guess....

Option 1 : Keep the same order in English and French. For that to work we would have to force/trick the translation in French :

with translation being:

fr.yml : answered_by: "Answered " => fr: "Mis(e) à jour il y a " answered_by_part2: " by " => "par"

Javascript : prefixAgo: null, prefixFromNow: null, suffixAgo: "ago", => fr: null suffixFromNow: "from now", => fr: null seconds: "less than a minute", => fr: moins d’une minute minute: "about a minute", => fr: environ une minute minutes: "%d minutes", => fr: %d minutes hour: "about an hour", => fr: environ une heure hours: "about %d hours",=> fr: environ %d heures day: "a day", => fr: un jour days: "%d days", => fr: %d jours month: "about a month", => fr: environ un mois months: "%d months", => fr: %d mois year: "about a year", => fr: environ un an years: "%d years", => fr: %d ans wordSeparator: " ", numbers: []

or Option 2: Have a different order according to the language used:

English: ["Answered" block] | [when block"] | ["by whom" block] French: ["by whom" block] | ["Answered" block] | [when block"]

So we would have:

English: Answered | less than a minute ago | by [username] French: [username] | a répondu à cette question | il y a moins d'une minute

and translation would be:

fr.yml : answered_by: "Answered " => fr: "a répondu à cette question " answered_by_part2: " by " => ""

Javascript : prefixAgo: null,=> fr: "il y a " prefixFromNow: null, suffixAgo: "ago", => fr: null suffixFromNow: "from now", => fr: null seconds: "less than a minute", => fr: moins d’une minute minute: "about a minute", => fr: environ une minute minutes: "%d minutes", => fr: %d minutes hour: "about an hour", => fr: environ une heure hours: "about %d hours",=> fr: environ %d heures day: "a day", => fr: un jour days: "%d days", => fr: %d jours month: "about a month", => fr: environ un mois months: "%d months", => fr: %d mois year: "about a year", => fr: environ un an years: "%d years", => fr: %d ans wordSeparator: " ", numbers: []

What do you think....?

weiweishi commented 9 years ago

used option 2 as @mhvezina listed above.