Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

translations from two keys visible as one, placed in one field #103

Open
rajaaa92 opened this issue Mar 26, 2015 · 4 comments
Open

translations from two keys visible as one, placed in one field #103

rajaaa92 opened this issue Mar 26, 2015 · 4 comments

Comments

@rajaaa92
Copy link

When adding a new locale, we get a lot of phrases to translate. One of them is the one with the key activerecord.errors.messages.restrict_dependent_destroy. It looks like this in the english version (visible on tolk):

---
one: Cannot delete record because a dependent %{record} exists
many: Cannot delete record because dependent %{record} exist

In my app I ask people not related to programming to translate the app. So if they see this phrase, they start to translate the "one" and "many", forget about the "---" etc. And when clicking on Save, they get an ugly error (Psych::SyntaxError: (): mapping values are not allowed in this context). Would it be possible, to split this phrase into 2 separate phrases, with two separate keys? So that for the key activerecord.errors.messages.restrict_dependent_destroy.one they would have to translate Cannot delete record because a dependent %{record} exists and the second by analogy.

I know those phrases are already translated on the internet and I could add them to the app. I will do, but sometimes they add a new locale, let's say, for fun, without telling me, so I don't add the translations and I don't run the import for all the locales in the world if I'm not asked to. Still, I would like to avoid seeing the error.

Thanks!

@mauriciopasquier
Copy link

Yeah, I find this really weird. Why are these keys treated differently? They should be 2 keys:

activerecord.errors.messages.restrict_dependent_destroy.one
activerecord.errors.messages.restrict_dependent_destroy.other

@nAzgalor
Copy link

because there is PLURALIZATION in the code

@nAzgalor
Copy link

I have another error:
Psych::SyntaxError ((<unknown>): could not find expected directive name while scanning a directive at line 1 column 1):

example the same.

---
one: Cannot delete record because a dependent %{record} exists
many: Cannot delete record because dependent %{record} exist

When I add only one translation, for example:
%{record}
I will get this error
Psych::SyntaxError ((<unknown>): could not find expected directive name while scanning a directive at line 1 column 1):

@marcindrozd
Copy link
Contributor

Has anyone was able to solve this?

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

No branches or pull requests

4 participants