Hi,
I’m using i.e. <%= t :search_users_posts, :possessive => true %> to get
“Search user’s posts”. But what if the language I’m translating it to
doesn’t use apostrophe, how do I translate such things / remove it?
Thanks
Hi,
I’m using i.e. <%= t :search_users_posts, :possessive => true %> to get
“Search user’s posts”. But what if the language I’m translating it to
doesn’t use apostrophe, how do I translate such things / remove it?
Thanks
Conjugations, etc. tough one and a real pain, I agree. Norman Clark is
working on a library that is attempting to solve that. You can check
it out here:
I would love if any of that would make it into the standard I18n gem.
Greetings,
Juergen
On Tue, Jun 8, 2010 at 12:05, Jürgen Feßlmeier
[email protected]wrote:
Conjugations, etc. tough one and a real pain, I agree. Norman Clark is
working on a library that is attempting to solve that. You can check it out
here:GitHub - norman/spanish: Linguistic utilities for working with Spanish words.
I would love if any of that would make it into the standard I18n gem.
Thanks for the mention, though I should say I’m still a long way off
from
having any of that implemented. It’s unfortunately still just vaporware.
2010/6/8 Tony M. [email protected]
Hi,
I’m using i.e. <%= t :search_users_posts, :possessive => true %> to get
“Search user’s posts”. But what if the language I’m translating it to
doesn’t use apostrophe, how do I translate such things / remove it?Thanks
<%= t :search_users_posts %>
en.yml :
search_users_posts: “Search user’s posts”
es.yml
search_users_posts: “Buscar los post del usuario”
Sorry, i don’t understand the problem
My bad, I shoulda explained, what I’m doing is something like
search_users_posts: “Search {{user}} posts”
2010/6/8 Andrés gutiérrez [email protected]
2010/6/8 Tony M. [email protected]
My bad, I shoulda explained, what I’m doing is something like
search_users_posts: “Search {{user}} posts”
<%= t :search_users_posts, :user => @user.name %>
en.yml :
search_users_posts: “Search {{user}}'s posts”
es.yml
search_users_posts: “Buscar los post de {{user}}”
Sorry, I think I still do not understand your problem.
2010/6/8 Andrés gutiérrez [email protected]
Yeah you’re right man, why don’t I just do that. I was looking at what
our
previous developer did. Thanks a lot Mr Andrés!
2010/6/8 Andrés gutiérrez [email protected]
2010/6/8 Tony M. [email protected]
Yeah you’re right man, why don’t I just do that. I was looking at what our
previous developer did. Thanks a lot Mr Andrés!I love being useful
Greetings
Unfortunately there is no easy solution, and your case is still a
simple one, as your substitute is the user name.
“Search {{user}} posts” % [link_to("{{user}}'s" % [h(@user.name)],
user_path(@user))]
This works great in English but not in other languages.
It becomes a real pain, when you substitute entire words of a
sentence, you end up with bad grammar in other languages. Consider
this:
“Please accept this {{post}}!”
In the example below, if you substitute {{post}} for “blog” or
“article”, it still makes lots of sense in English, but in Spanish,
German, etc. you have to deal with gender (der Artikel, e.g. “el”,
“la”) or conjugations, (German: der (nominative), des (genitiv),
dessen (dativ), dem (akkusative)).
The solutions I can think of today are:
change the sentence structure so it works for other languages ->
least common denominator, does not really sound great, difficult as
you may not know enough about the languages
don’t substitute, e.g. have multiple combination for same sentence
depending on context
Greetings,
Juergen
The problem is actually, that:
<%= t :search_users_posts, :user => @user.name %>
search_users_posts: “Search {{user}}'s posts”
Produces “Search user http://test’s posts” (that orphan 's doesn’t
look
too good)
And not “Search user’s http://test posts” which the following would
produce:
<%= t :search_users_posts, :user => @user.name, :possessive => true %>
search_users_posts: “Search {{user}} posts”
Is there an easy way to fix this?
2010/6/8 Andrés gutiérrez [email protected]
Thank y’all so much for this valuable insight. I decided to do as you
suggested Jürgen and cut the Gordian Knot by just changing the sentence
structure.
Thanks again!
On Thu, Jun 10, 2010 at 1:32 PM, Jürgen Feßlmeier <
2010/6/10 Tony M. [email protected]
And not “Search user’s http://test posts” which the following would
produce:<%= t :search_users_posts, :user => @user.name, :possessive => true %>
search_users_posts: “Search {{user}} posts”
Is there an easy way to fix this?
I don’t know. You would may put the entire phrase inside the link
<%= link_to I18n.t(:search_users_posts, :user => @user.name),
your_route_path(@user) %>
#=> Search user’s posts http://test/
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs