Skip to content
This repository was archived by the owner on Apr 3, 2020. It is now read-only.

Use php-intl for translation instead of built in Laravel's translator #244

Open
pklebba opened this issue Aug 21, 2016 · 2 comments
Open

Comments

@pklebba
Copy link

pklebba commented Aug 21, 2016

My friend made that package for Laravel for better language support than built in solution: https://github.com/Skysplit/laravel5-intl-translation

You can say, why? So, currently it is impossible to properly format plural rules in many languages, as in some languages' rules are not just ranges, but often require modulo operations etc. MessageFormatter allows it.

For example, let's use Polish word "miesiąc" (means "month"):

  • one - 1 - Miesiąc
  • few - 24, 2224, 3234, 4244, 52~54, 62, 102, 1002, … - Miesiące
  • many - 0, 5~19, 100, 1000, 10000, 100000, 1000000, … - Miesięcy
  • other - 0.0~1.5, 10.0, 100.0, 1000.0, 10000.0, 100000.0, 1000000.0, … - Miesiąca

More here: http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#pl

It's not possible to correctly implement that word in built in Laravel's package. In English language it's not a problem, because here we have just two options: month and months. But there's a problem for Polish, Russian, Arabic and many more. That's why I think it should be taken into consideration.

He's working on it in official Laravel repository: laravel/ideas#160

@euantorano
Copy link
Member

Hi,

I wasn't aware of these problems in the standard Lang package, if it doesn't support those required features, we will have to look elsewhere for definite. Thanks for bringing it to our attention!

@pklebba
Copy link
Author

pklebba commented Aug 21, 2016

That's great, thanks! 😄

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

2 participants