Translation improvements #50161
Unanswered
lukas-frey
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Unite trans and trans_choice
Is there a reason why the
trans
andtrans_choice
methods are separated? Wouldn't it be easier and more laravel-like to have a simpletrans($key = null, $number = 1, array $replace = [], $locale = null)
method that would work for both?When no number is provided (by default 1) it will just return the translation or the singular version of it, if a number is provided it will return the pluralized version of the string?
It always bugs me to have to use different methods when using localization.
Simple switch
Another improvement could be to add simple "switches" based on a property. Some languages (like czech) have a slightly different word-endings based on the gender you are talking to.
So for example for the sentence
"You have been added to the team :team."
in czech, it would be:For males:
"Byl jsi přidán do týmu :team"
.For females:
"Byla jsi přidána do týmu :team"
.Even in an english sentence, for example if you would localize the greeting in a formal e-mail:
"Hello Mr. :name"
/"Hello Mrs. :name"
it would make sense to have the ability to define it inside a single localization string instead of having to create two separete strings. The localization strings might look like this:Beta Was this translation helpful? Give feedback.
All reactions