Re: [openstreetmap/openstreetmap-website] Source of translations of future dates (Issue #5769)

2025-03-19 Thread aceman444 via rails-dev
aceman444 left a comment (openstreetmap/openstreetmap-website#5769)

The future dates are also used in the string 'Osm:Notes.show.disappear date 
html' (This resolved note will disappear from the map in %{disappear_in}.), so 
this may be more visible to the users than in the user blocks page.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/5769#issuecomment-2738128070
You are receiving this because you are subscribed to this thread.

Message ID: 
___
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev


Re: [openstreetmap/openstreetmap-website] Source of translations of future dates (Issue #5769)

2025-03-13 Thread aceman444 via rails-dev
aceman444 left a comment (openstreetmap/openstreetmap-website#5769)

I have a suspicion German language also has this problem with future time 
intervals. The OSM blocks page writes "in 10 Jahre", instead of "in 10 Jahren", 
also "in etwa ein Jahr" instead of "in etwa einem Jahr". Intervals in past seem 
OK, "vor etwa einer Stunde", "vor einem Tag", "vor 3 Tagen".
German has declensions too depending on context (grammatical case). But please 
call a German speaker onto this.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/5769#issuecomment-2723804979
You are receiving this because you are subscribed to this thread.

Message ID: 
___
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev


Re: [openstreetmap/openstreetmap-website] Source of translations of future dates (Issue #5769)

2025-03-10 Thread aceman444 via rails-dev
aceman444 left a comment (openstreetmap/openstreetmap-website#5769)

Hi, you cannot take a string produced by Rails (or anything) and then just 
prepend or append any random words to it in OSM strings. That is just invalid 
Internationalization (i18n) of the program. You must allow for translation of 
whole strings or sentences, you cannot randomly concatenate strings into a 
sentence. The added words may change the context of the whole sentence and 
cause some of the other concatenated parts to require different forms of the 
translated words.
See the discussion at 
https://translatewiki.net/wiki/Translating_talk:OpenStreetMap#About_Osm:User_blocks.helper.short.time_in_future_title/en
 .

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/5769#issuecomment-2712131027
You are receiving this because you are subscribed to this thread.

Message ID: 
___
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev


Re: [openstreetmap/openstreetmap-website] Source of translations of future dates (Issue #5769)

2025-03-12 Thread aceman444 via rails-dev
aceman444 left a comment (openstreetmap/openstreetmap-website#5769)

Well, that is mostly correct, but it is a coincidence. Some other language may 
need all 3 forms. And the bug is that even if OSM has that "almost 5 years" 
string, it only uses it for duration and not for the future form of "in 5 
years" string, so the result in OSM is wrong and not what the Translator 
produced. But I do not suggest to do this, as some other language may then come 
out wrong. Next time you add a string with some other preposition instead of 
"in" and there would need to be another form of the words as none of those 
presented above will be correct. So all the various prepositions (like 'in', 
'ago', 'with', 'to') need their own separate strings to translate.

Actually the ideal situation would be to present whole sentences where the 
times are used, like "Created X days ago" (Osm:Api.notes.comment.opened at 
html) and some language may call you out to do this (as the 3 forms discussed 
here and then concatenated into other strings like 
"Osm:Api.notes.comment.opened at html" may not be enough). But then you would 
need to drop all the hours/day/months/years variants, as it would be insane to 
have all the combinations.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/5769#issuecomment-2716806003
You are receiving this because you are subscribed to this thread.

Message ID: 
___
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev


Re: [openstreetmap/openstreetmap-website] Source of translations of future dates (Issue #5769)

2025-03-13 Thread aceman444 via rails-dev
aceman444 left a comment (openstreetmap/openstreetmap-website#5769)

Maybe other translators are not aware and do not check how the strings are 
really used on the webpage. Some of the strings have very good context 
descriptions of their usage directly at the weblate interface (thanks!). But 
some have none.
I have found the same problem with the future time intervals ('in X months') 
exists also in the Czech language (cs).

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/5769#issuecomment-2722659581
You are receiving this because you are subscribed to this thread.

Message ID: 
___
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev


Re: [openstreetmap/openstreetmap-website] Source of translations of future dates (Issue #5769)

2025-03-11 Thread aceman444 via rails-dev
aceman444 left a comment (openstreetmap/openstreetmap-website#5769)

Yes, in English all the 3 phrases contain the same "almost 10 years", but in 
Slovak they should be different.
The phrase "takmer 10 rokmi" is correct when it talks about the past ('X 
time-length ago').
But when it is in the future (English 'in X time-length') it should be 
different ('takmer 10 rokov'). There are declinations of words in Slovak so the 
context is important and simply we need to have full strings in OSM that can be 
translated correctly into every language.
I think you currently use 3 forms on the OSM website:
1.  ago (in the past)
2. in  (in the future)
3.  (when talking about duration)

for  you currently use the same string (X 
days/hours/weeks/years) and that is the bug, as the form of it depends on the 
context.

You would need in OSM to have all the strings for translation:
%{count} hours ago
%{count} days ago (Osm:Datetime.distance in words ago.x days)
%{count} weeks ago
%{count} months ago
%{count} years ago
almost %{count} years ago
over %{count} years ago
in %{count} hours
in %{count} days (OSM string missing!)
in %{count} weeks
in %{count} months
in %{count} years
%{count} hours
%{count} days (Osm:User blocks.helper.block duration.days)
%{count} weeks
%{count} months
%{count} years

Of course all of them using the {{PLURAL|||}} syntax. And these strings must 
not be concatenated with other strings

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/5769#issuecomment-2715697075
You are receiving this because you are subscribed to this thread.

Message ID: 
___
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev


Re: [openstreetmap/openstreetmap-website] Source of translations of future dates (Issue #5769)

2025-03-12 Thread aceman444 via rails-dev
aceman444 left a comment (openstreetmap/openstreetmap-website#5769)

That is exactly what I propose in comment 
https://github.com/openstreetmap/openstreetmap-website/issues/5769#issuecomment-2715697075
 . The 3 different contexts.
It is true that in Slovak distance_in_words_duration and 
distance_in_words_in_future have the same form. But that may not be true for 
all languages.

>Thanks for the additional details. It would be helpful if you can share the 
>exact slovakian translations of:
> * A duration of time: "about 10 years"
This would be "približne 10 rokov".

> * A time in the future: "in about 10 years"
This would be "o približne 10 rokov".

> * Describing something ending in the future: "Ends in about 10 years".
This would be "Končí o približne 10 rokov". In Slovak you can in this case 
prepend "Ends" before the "in about 10 years" . But it again may not work in 
other languages. But if you offered the full string for translation (which 
would be the ideal case) you have the problem as described below.

> As far as I can see so far, we have a few issues here.
> * We can't translate every sentence that contains a duration, future time 
> or past time separately. We have [13 different types of 
> time](https://github.com/openstreetmap/openstreetmap-website/blob/432fa57e61c5535eb955ee50529aa43b18787fe4/config/locales/en.yml#L165-L201),
>  and each of those need a language-dependent number of translations (normally 
> 2-4) and we use dates in many different places on the website. So some sort 
> of consolidation and interpolation is necessary.

Correct. You would have to drop those 13 types of time. If there was only one, 
then you could provide every sentence complete for translation. Most of them 
are only used for past times (e.g. creation times of something). Only the block 
times are in the future.

> * rails has a few [time 
> helpers](https://api.rubyonrails.org/classes/ActionView/Helpers/DateHelper.html),
>  and by default they use the same translation scope for every helper. (Some 
> of the helpers are also slightly misleadingly named).
> 
> * We currently have two sources of time translations:
>   
>   * rails-i18n, which we use for durations and future times
>   * our own 
> [distance_in_words_ago](https://github.com/openstreetmap/openstreetmap-website/blob/432fa57e61c5535eb955ee50529aa43b18787fe4/config/locales/en.yml#L164)
>  which [we use for past 
> times](https://github.com/openstreetmap/openstreetmap-website/blob/master/app/helpers/application_helper.rb#L28-L34%5D(https://github.com/openstreetmap/openstreetmap-website/blob/432fa57e61c5535eb955ee50529aa43b18787fe4/app/helpers/application_helper.rb#L28-L34))
> 
> * I think the problem might be that some translations in rails-i18n are 
> correct for past times, and therefore not durations or future times (e.g. 
> slovakian, see 
> [sk](https://github.com/svenfuchs/rails-i18n/blob/5e37210c8d3506f8b6925c67752d85fbee15a2a4/rails/locale/sk.yml#L77))
>  but others are correct for durations/future times (e.g. 
> [de](https://github.com/svenfuchs/rails-i18n/blob/5e37210c8d3506f8b6925c67752d85fbee15a2a4/rails/locale/de.yml#L96)),
>  see also [Better translations for time_ago_in_words 
> #2255](https://github.com/openstreetmap/openstreetmap-website/issues/2255).

Correct, Rails only has one form of the words and does not distinguish which 
(future or past) context you need. So it has one and serves it to OSM and it is 
then used wrongly into concatenated strings. It fails for Slovak, but may be 
correct in other languages. If you say different languages actually have 
different contexts (past/future) written in that 1 Rails form, then it is 
indeed a mess and that may be why not many people complained yet.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/5769#issuecomment-2718469995
You are receiving this because you are subscribed to this thread.

Message ID: 
___
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev