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:
<openstreetmap/openstreetmap-website/issues/5769/2718469...@github.com>
_______________________________________________
rails-dev mailing list
rails-dev@openstreetmap.org
https://lists.openstreetmap.org/listinfo/rails-dev