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

Translation Overrides doesn't work for a single key/value pair #1514

Closed
core77 opened this issue Jun 6, 2017 · 6 comments
Closed

Translation Overrides doesn't work for a single key/value pair #1514

core77 opened this issue Jun 6, 2017 · 6 comments

Comments

@core77
Copy link

core77 commented Jun 6, 2017

I created a /user/languages/de.yaml file like the [docs say].(https://learn.getgrav.org/content/multi-language#translation-overrides)

I put the following overrides in it:

PLUGIN_SIMPLESEARCH:
     SEARCH_PLACEHOLDER: "Suche im Blog ..."

The override for the SEARCH_PLACEHOLDER string works. But the other strings for the simplesearch plugin are showing up in english.

I fixed this for me by pasting in all the german strings for the simplesearch plugin but expected it would work for only one key/value pair...

@paulmassen
Copy link
Contributor

Interested in this too, but I think it's a problem with admin plugin actually.
I think you might have to add all the other translations, see also: getgrav/grav-plugin-admin#422

@paulmassen
Copy link
Contributor

Also, as I suppose you want to use that as a placeholder, just use another prefix, such as:

MYCUSTOMSTRINGS:
SEARCH_PLACEHOLDER: "Suche im Blog ..."
```

And reference it in your form with
MYCUSTOMSTRINGS.SEARCH_PLACEHOLDER

@flaviocopes
Copy link
Contributor

Yes, currently if you override a single string, you must also add all the other strings of the plugin, it's a known bug.

@rhukster
Copy link
Member

This is fixed in the PR mentioned above, please test....

@rhukster
Copy link
Member

Merged this manually...

@sarbanha
Copy link

I encountered the same problem, I noticed that Theme language variables precede the user/language variables, when I comment out a variable in theme language file, Grav tries to find it in user overrides.

I suppose user overrides must precede the theme language variables.

Grav 1.7.38

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

5 participants