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

Strings to translate contain incomplete sentences #8272

Open
gunchleoc opened this issue Jul 14, 2021 · 2 comments
Open

Strings to translate contain incomplete sentences #8272

gunchleoc opened this issue Jul 14, 2021 · 2 comments

Comments

@gunchleoc
Copy link

Some examples of incomplete sentences to translate that I found in the translation project:

is already taken.
is invalid.

Some languages cannot start a sentence with a noun - this forces grammar errors on the translations (not pretty sentences this will make). What we need here is to use a place holder, so we can translate e.g.:

%s is already taken.
%s is invalid.

as

Tha %s mì-dhligheach.
Tha %s ’ga chleachdadh mu thràth.
@weex
Copy link

weex commented Jul 29, 2021

The good thing about this particular problem is that there aren't that many of this particular form. Also, it may be possible solve without code changes. For example in https://github.com/diaspora/diaspora/blob/develop/app/models/user.rb#L501:

errors.add(:unconfirmed_email, I18n.t("errors.messages.taken")) can stay the same and the english version could change to something like.

"unconfemail@example.com This email address is already taken."

@jhass
Copy link
Member

jhass commented Jul 31, 2021

The proper solution is to use the full per key translations instead of the generic scopes. See https://guides.rubyonrails.org/i18n.html#error-message-scopes

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

No branches or pull requests

3 participants