Skip to Content Skip to Menu

[SOLVED] Substitution with translation string

  • gtrennert
  • gtrennert
  • OFFLINE
  • Posts: 133
  • Thanks: 4
  • Karma: 0
8 years 7 months ago - 8 years 7 months ago #271020 by gtrennert
Hello

cb 2.0.10

I am using substitutions on a custom field for Profile Value Layout and Userlist Value Layout
Depending of the value of another custom field I want to show the value of the field or a string
This string should be translated so I entered something like this :
Code:
[cb:if cb_approvexxx includes "1"] [cb_xxx] [/cb:if] [cb:if cb_approvexxx includes "0"] _UE_CURRENTVALIDATION [/cb:if]
I defined _UE_CURRENTVALIDATION in components/com_comprofiler/plugin/language/fr-fr/language.php as follows :
Code:
'_UE_CURRENTVALIDATION' => 'En cours de validation',

But the translation does not work - in french it shows _UE_CURRENTVALIDATION and not En cours de validation.

Do translations work in substitutions ?
Last edit: 8 years 7 months ago by krileon.

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

  • activha
  • activha
  • OFFLINE
  • Posts: 2280
  • Thanks: 113
  • Karma: 13
8 years 7 months ago #271078 by activha
Replied by activha on topic Substitution with translation string
I have exactly the same question for layouts.
Have tried to set the translation in cblanguageoverride-language.php in my cbplugin folder of the language, but does not work neither

any hint ?

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

  • activha
  • activha
  • OFFLINE
  • Posts: 2280
  • Thanks: 113
  • Karma: 13
8 years 7 months ago #271079 by activha

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

  • gtrennert
  • gtrennert
  • OFFLINE
  • Posts: 133
  • Thanks: 4
  • Karma: 0
8 years 7 months ago - 8 years 7 months ago #271084 by gtrennert
Replied by gtrennert on topic Substitution with translation string
Thanks - but this did not help - its not a partial tranlsation
Ok It seems that I forgot the [] but with :
Code:
[cb:if cb_approvedescription includes "1"] [cb_description] [/cb:if] [cb:if cb_approvedescription includes "0"] [_UE_CURRENTVALIDATION] [/cb:if]
It does not work either !
Last edit: 8 years 7 months ago by gtrennert.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 68625
  • Thanks: 9109
  • Karma: 1434
8 years 7 months ago #271085 by krileon
Replied by krileon on topic Substitution with translation string
You can not use language strings inline like that. Parsing of it would be basically impossible as it'd be very easy to mistake a string for a language key and be parsing hundreds of strings unnecessarily. You basically need to translate the entire string it self as activha has linked.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

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

  • gtrennert
  • gtrennert
  • OFFLINE
  • Posts: 133
  • Thanks: 4
  • Karma: 0
8 years 7 months ago #271087 by gtrennert
Replied by gtrennert on topic Substitution with translation string
Sorry but what do you mean by entire string ?
I want to either display the description of the user (no tranlsation) or a string indicating that the description is not yet validated
Perhaps there is another way to do this ?

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

Moderators: beatnantkrileon
Powered by Kunena Forum

Facebook Twitter LinkedIn