How does context translation with Loco / Localise.biz work? (xliff)

65 Views Asked by At

Edit: Im not using wordpress.

I have the word "von" on my website, which can translate into "from", "by" and "of". I tried to work with context, which does not work for me.

Creating a new Asset in Loco i put in "von". Skipping the Asset ID i put "by" into the context field. Loco automatically creates the Asset ID as "by-von". The resulting xlf file trans-unit:

<trans-unit id="loco:651ed033d280c3915408c422">
  <source>by-von</source>
  <target>by</target>
</trans-unit>

How would i use it in my php file now?

trans('von', [], 'hotelbewertung', 'by'); results in the von not being translated.

trans('by-von', [], 'hotelbewertung', 'by'); results in the website showing by-von.

The Loco Documentary is utterly terrible and i cant seem to find any hints in the web or youtube. ChatGPT does show another xlf structure when using context - but since Loco generated the unit as seen above i didnt look further into that.

0

There are 0 best solutions below