Defect #25130

support of agglutinative languages like Hungarian/Magyar

Added by Greg T almost 2 years ago. Updated 2 months ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Translations
Target version:Candidate for next major release
Resolution: Affected version:

Description

I tried to fix hu.yml, but the time related strings are used in to many contexts incompatibly, so even subtle/clumsy rewording can't help in all cases. We don't use plural form after numbers greater than one, but we use other forms for different expressions.

E.g. hour is óra in Magyar;
[point in time] x hour(s) ago is x órája or x órával ezelőtt;
[present perfect continuous] for x hour(s) is x órája;
[past, future or undetermined tense] for x hour(s) is x óráig or x órán át.

Label_added_time_by needs point in time (and optional non-relative times, but that's a different issue, although a possible workaround);
while e.g. setting_session_lifetime needs óra without agglutination.

Filters:
label_between: between x [and] y should be x és y között;
day related filters are somewhat clumsy in English, too (e.g. less than days ago ... days), but I could improve it in Magyar: "label_less_than_ago: nem régebbi, mint" meaning not older than, but it must be followed by x nap (base word of day), not x napja (point in time);
label_in_the_past_days: needs to be followed by napban (base word of day + in postfix), etc.

distance_in_words.patch Magnifier - requested at 25402#note-2 (26.1 KB) Greg T, 2017-03-23 10:33

lang_datetime.pl Magnifier (954 Bytes) Greg T, 2018-01-17 15:35


Related issues

Related to Redmine - Patch #25402: stop misusing distance_in_words Closed

History

#1 Updated by Greg T almost 2 years ago

Elements of datetime.distance_in_words should not be used outside of the method distance_of_time_in_words. Please duplicate the x_days and x_hours strings outside of the distance_in_words array in the language files and use those where needed.

Does it help if I attach a patch?

x_days is currently:

          one: '1 napja'
          other: '%{count} napja'
in hu.yml. That works for e.g.
label_added_time_by: "%{author} adta hozzá %{age}".
It makes no sense in other contexts.

While x_hours is

        one:   "1 óra" 
        other: "%{count} óra" 
which is not correct for the current label_added_time_by (which needs órája), but is OK in some other places.

  • In issue_relation.rb
      def to_s(issue=nil)
        issue ||= issue_from
        issue_text = block_given? ? yield(other_issue(issue)) : "##{other_issue(issue).try(:id)}" 
        s = []
        s << l(label_for(issue))
        s << "(#{l('datetime.distance_in_words.x_days', :count => delay)})" if delay && delay != 0
        s << issue_text
        s.join(' ')
      end
    
    needs the root word nap instead of datetime.distance_in_words.x_days.
In settings_helper.rb
  • session_lifetime_options
    needs the root words (óra and nap) instead of datetime.distance_in_words.x_hours and datetime.distance_in_words.x_days;
  • session_timeout_options
    needs the root word óra instead of datetime.distance_in_words.x_hours.
In _authentication.html.erb
  • autologin
    Instead of datetime.distance_in_words.x_days, we either need "x napig" (for/up to x day(s)), or - better yet - we need the root word nap AND setting_autologin needs to be changed to Automatikus bejelentkezés érvényességi ideje (... ~ expiration time).
  • password_max_age
    Instead of datetime.distance_in_words.x_days, we need the root word nap.

#2 Updated by Toshi MARUYAMA over 1 year ago

  • Category changed from I18n to Translations

#3 Updated by Toshi MARUYAMA over 1 year ago

In Russian source:tags/3.3.2/config/locales/ru.yml#L124

      x_days:
        one:   "%{count} день" 
        few:   "%{count} дня" 
        many:  "%{count} дней" 
        other: "%{count} дня" 

#4 Updated by Greg T over 1 year ago

Toshi MARUYAMA wrote:

In Russian source:tags/3.3.2/config/locales/ru.yml#L124

What do you mean by that note?
I've found what you mean here.
That's a whole different problem. Hungarian uses the same singular nouns after any number.

Alas, I cannot change the subject, but this issue is about the misusing of distance_in_words array. See note-1.

#5 Updated by Toshi MARUYAMA over 1 year ago

"distance_in_words" is Rails core feature.

#6 Updated by Greg T over 1 year ago

Toshi MARUYAMA wrote:

"distance_in_words" is Rails core feature.

So? Have you read my note-1?
"Elements of datetime.distance_in_words should not be used outside of the method distance_of_time_in_words."

#7 Updated by Toshi MARUYAMA over 1 year ago

Greg T wrote:

Toshi MARUYAMA wrote:

"distance_in_words" is Rails core feature.

So? Have you read my note-1?
"Elements of datetime.distance_in_words should not be used outside of the method distance_of_time_in_words."

Please post a patch because I cannot understand.

#8 Updated by Greg T over 1 year ago

See issue #25402 with my patch.

#9 Updated by Toshi MARUYAMA over 1 year ago

  • Related to Patch #25402: stop misusing distance_in_words added

#10 Updated by Greg T over 1 year ago

#11 Updated by Greg T 11 months ago

Would you accept my patch, please?

#12 Updated by Toshi MARUYAMA 11 months ago

Where did you pick datetime.x_hours and datetime.x_days from in other languages?

#13 Updated by Greg T 11 months ago

Toshi MARUYAMA wrote:

Where did you pick datetime.x_hours and datetime.x_days from in other languages?

I upload a perl script I think I used for that.

#14 Updated by Greg T 7 months ago

Would you accept my patch, please?

#15 Updated by Go MAEDA 7 months ago

I will try to understand the expression of numbers and "ago" in Hungarian, to understand the patch.

p.s. My native language is Japanese. It is also agglutinative language.

#16 Updated by Go MAEDA 7 months ago

  • Target version set to Candidate for next major release

#17 Updated by Greg T 7 months ago

Go MAEDA wrote:

I will try to understand the expression of numbers and "ago" in Hungarian, to understand the patch.

p.s. My native language is Japanese. It is also agglutinative language.

Thanks. I chose a wrong subject that I'm not allowed to modify here. I think I have a better description in Patch #25402 ("stop misusing distance_in_words").

#18 Updated by Greg T 2 months ago

How can I help?

Also available in: Atom PDF