Keyword

[SOLVED] Translations with variable parts

  • Björn
  • Björn's Avatar Topic Author
  • Offline
  • New Member
More
10 years 11 months ago #119099 by Björn
I'm working on a Dutch language K2/Joomla site. Right now I'm having some issues with K2 & the Dutch translation.

It looks like the language files assume word ordering, which leads to problem like for instance the sentence "Read [X] times" (with [X] replaced with the number of hits). Now for Dutch the actual ordering of words doesn't work, but the text seems to be made up out of K2_READ [X] K2_TIMES which means it cannot be translated properly.

In Joomla in general you've got string replacement with %s in language files, but this doesn't seem to be the case with K2. Is there any plan on restructuring the language files to make them more translatable?

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 11 months ago #119100 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Translations with variable parts
Hello Björn,

Have you tried grabbing a new version of the K2 language files? You can find the files here: getk2.org/extend/translations

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Björn
  • Björn's Avatar Topic Author
  • Offline
  • New Member
More
10 years 11 months ago #119101 by Björn
Replied by Björn on topic Re: Translations with variable parts
Krikor, thank you for your quick reply but I'm afraid I might not have been totally clear with what I meant.

There is no issue with the quality of the Dutch translation.

The issue is that the order of words in the text fragment "Read [X] times" is fixed because there is no language string in the language files for that fragment. Instead there is one for "read" and one for "times". And then the K2 component puts the words in that order with the number in the middle. But in Dutch you want the order to be "[X] times read". So while the words "read" and "times" are translated just fine, K2 will always put the words in the (for Dutch) wrong order.


The way other parts of Joomla solve this is with string substitutions. And example:
COM_CHECKIN_N_ITEMS_CHECKED_IN_MORE="%s items checked-in"
Now, in Dutch the word order is pretty much the same, but lets just pretend that the number would have to be somewhere in the middle, then you still could translate it to
COM_CHECKIN_N_ITEMS_CHECKED_IN_MORE="Checked-in %s items"

But this isn't possible at the moment with K2.


I'm sorry if I'm being unclear, but I hope you understand what I'm trying to say.

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 11 months ago #119102 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Translations with variable parts
Yes I got it.

No, currently this functionality is not available. You can however override your template's item.php and category.php and reorder the language strings. Since they are two seperate strings reordering won't be an issue.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Björn
  • Björn's Avatar Topic Author
  • Offline
  • New Member
More
10 years 11 months ago #119103 by Björn
Replied by Björn on topic Re: Translations with variable parts
Okay. I'll look into overriding. Thanks for the help!

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
10 years 11 months ago #119104 by Krikor Boghossian
Replied by Krikor Boghossian on topic [SOLVED] Translations with variable parts
You 're welcome

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum