Project

General

Profile

Actions

Defect #25130

open

support of agglutinative languages like Hungarian/Magyar

Added by Greg T almost 8 years ago. Updated about 5 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Translations
Start date:
Due date:
% Done:

0%

Estimated time:
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.


Files

distance_in_words.patch (26.1 KB) distance_in_words.patch requested at 25402#note-2 Greg T, 2017-03-23 10:33
lang_datetime.pl (954 Bytes) lang_datetime.pl Greg T, 2018-01-17 15:35

Related issues

Related to Redmine - Patch #25402: stop misusing distance_in_wordsClosed

Actions
Actions #1

Updated by Greg T over 7 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.
Actions #2

Updated by Toshi MARUYAMA over 7 years ago

  • Category changed from I18n to Translations
Actions #3

Updated by Toshi MARUYAMA over 7 years ago

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

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

Updated by Greg T over 7 years 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.

Actions #5

Updated by Toshi MARUYAMA over 7 years ago

"distance_in_words" is Rails core feature.

Actions #6

Updated by Greg T over 7 years 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."

Actions #7

Updated by Toshi MARUYAMA over 7 years 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.

Actions #8

Updated by Greg T over 7 years ago

See issue #25402 with my patch.

Actions #9

Updated by Toshi MARUYAMA over 7 years ago

  • Related to Patch #25402: stop misusing distance_in_words added
Actions #11

Updated by Greg T almost 7 years ago

Would you accept my patch, please?

Actions #12

Updated by Toshi MARUYAMA almost 7 years ago

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

Actions #13

Updated by Greg T almost 7 years 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.

Actions #14

Updated by Greg T over 6 years ago

Would you accept my patch, please?

Actions #15

Updated by Go MAEDA over 6 years 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.

Actions #16

Updated by Go MAEDA over 6 years ago

  • Target version set to Candidate for next major release
Actions #17

Updated by Greg T over 6 years 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").

Actions #18

Updated by Greg T about 6 years ago

How can I help?

Actions #19

Updated by Greg T about 5 years ago

Will you ever accept my patches, please?

Greg T wrote:

When x_hours and x_days are not used for a reference to a past point in time relative to the present moment then datetime.distance_in_words must not be used as it's impossible to fix the Hungarian/Magyar language files that way.

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.

Examples by Google Translates:
en
It happened 8 hours ago.
Session maximum lifetime: 8 hours.
It happened 8 years ago.
Session maximum lifetime: 8 years.

ja (I don't know kanjis/Japanese at all, sorry.)
Sore wa 8-jikan mae ni okorimashita.
Sesshon no saidai yūkōkigen: 8-Jikan.
Sore wa 8-nen mae ni okorimashita.
Sesshon no saidai yūkōkigen: 8-Nen.

hu
8 órával ezelőtt történt.
A munkamenet maximális élettartama: 8 óra.
8 évvel ezelőtt történt.
A munkamenet maximális élettartama: 8 év.

Actions

Also available in: Atom PDF