We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Sometimes I need to trasfer craft translation strings from twig to js. Unfortunetly i have to declate each string manually, like this:
var js_variable = '{{'craft_language_string'|t}}';
So, can you create Twig variable that would contain all translations for current language, so i can loop trought them?
The text was updated successfully, but these errors were encountered:
I think this should be possible in Craft and Twig already by looping through all the locales and getting that translation.
I'm not sure the exact syntax, but Craft's doc for |t links to Yii's docs for t() which has a parameter for $language.
|t
t()
$language
Sorry, something went wrong.
@missmatsuko I searched around a bit and didn't found a way to loop through translations without using a plugin.
andrelopez
No branches or pull requests
Sometimes I need to trasfer craft translation strings from twig to js. Unfortunetly i have to declate each string manually, like this:
var js_variable = '{{'craft_language_string'|t}}';
So, can you create Twig variable that would contain all translations for current language, so i can loop trought them?
The text was updated successfully, but these errors were encountered: