Muut
September 22, 2016, 12:10pm
1
Hey,
I currently build a grav page in english and german.
I currently have the links for my navigation defined in site.yaml because some pages shouldn’t be shown in the navigation so I can’t just loop over all pages.
However I haven’t figured out where I can put the translations for site.yaml.
Could you provide an example where to put the translations if in site.yaml I have:
menu:
text: Linktext
link: link
Thank you!
Muut
September 22, 2016, 1:19pm
2
Have you read the docs on multi-language support ? You would put site-wide translations in languages.yaml
.
Muut
September 22, 2016, 1:31pm
3
Thanks for the reply. Yes I read the docs but they didn’t really help me. In site.yaml I have an array
menu:
-
text: 'Für Brands'
link: 'brand'
-
text: 'Für Retailer'
link: 'retailer'
How would I translate those in languages.yaml?
Would I insert there
en:
THEME_FASHIONCLOUD:
menu:
-
text: 'For Brands'
....
How do I reference that site.yaml
's content is supposed to be replaced?
Muut
September 22, 2016, 6:05pm
4
Read responses of @flaviocopes and @rhukster in https://getgrav.org/forum#!/general:translation-of-site-title .
I show an example with which I translated the metadata description
in site.yaml
file.
In site.yaml
files, I replaced Grav is an easy to use, yet powerful, open source flat-file CMS
with METADATA_DESCRIPTION
.
In metadata.html.twig
file I added |t
to translate, so from {{ meta.content }}
to {{ meta.content }}
.
Inside user/languages/en.yaml
I added METADATA_DESCRIPTION: Grav is an easy ...
.
Inside user/languages/it.yaml
I added METADATA_DESCRIPTION: Grav è un facile ...
.
It works
Muut
September 22, 2016, 6:06pm
5
Great! I’m glad you got it worked out.
Muut
September 22, 2016, 6:13pm
6
The second one {{ meta.content }}
it’s wrong.
it’s right {{ meta.content|t }}
Muut
September 28, 2016, 5:16pm
7
@iusvar : Thank you so much!