Skip to content
This repository has been archived by the owner on Jul 24, 2021. It is now read-only.

support proper pluralization for other languages #2049

Closed
openstreetmap-trac opened this issue Jul 23, 2021 · 3 comments
Closed

support proper pluralization for other languages #2049

openstreetmap-trac opened this issue Jul 23, 2021 · 3 comments

Comments

@openstreetmap-trac
Copy link

Reporter: StefanB
[Submitted to the original trac issue database at 6.48pm, Thursday, 9th July 2009]

Currently ruby backend (with globalize2 and rails-i18n plugins) supports pluralization into only 3 forms, namely ":zero" ":one" and ":other", which is ok for English and perhaps some other languages.

It is not suitable for dynamically switching languages, serving several languages with different pluralizaton formula at the same time.

Specifically, pluralization formula for Slovenian should be something like:
backend.add_pluralizer :sl, lambda{|c|
c == 0 ? :zero : c%100 == 1 ? :one : c%100 == 2 ? :two : (3..4).include?(c%100) ? :few : :other
}
but there is no place to put it to have an effect, and not break current English website at the same time.

@openstreetmap-trac
Copy link
Author

Author: tomhughes
[Added to the original trac issue at 8.48am, Monday, 13th July 2009]

(In [16473]) Add custom pluralizer for Slovenian. Fixes #2049.

@openstreetmap-trac
Copy link
Author

Author: tom[at]compton.nu
[Added to the original trac issue at 8.58am, Monday, 13th July 2009]

The activerecord.errors.template.header resource in vendor/plugins/rails-i18n/locale/sl.rb needs fixing to have the extra keys. I've hacked it for now by copying the :other key but you'll need to fix it properly.

Also I don't know if the globalize2 people would be interested in having the custom pluralizer upstream?

@openstreetmap-trac
Copy link
Author

Author: StefanB
[Added to the original trac issue at 12.37pm, Monday, 13th July 2009]

Tnx for putting it in, seems to wokr fine, but some additional translations are needed if i understand the error message "Error contacting gazetteer.openstreetmap.org: uninitialized constant Globalize::Backend::Pluralizing::InvalidPluralizationData" correctly.

Will check and add the missing ones later today.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant