JSON file embedded content to lock placeholders

Hi,

 

I have received a JSON file with segments that contain many placeholders/variable within.

An example,

"description": "Out of {{totalReq}} {{'requirement' | devEntityDescription : true}}, <span ng-class=\"{'p-rdx--link-cursor' : {{count}}>0}\" ng-click=\"cqRiskIndicatorNav({{count}}>0 ? 'cqMaintainabilityRiskIndicator' : '')\">{{count}} {{'requirement' | devEntityDescription : true}} with {{riskStatus}} Priority {{category}} issues</span>",

"zeroIssuesDesc": "Out of {{totalReq}} {{'requirement' | devEntityDescription : true}}, 0 {{category}} known issues found"

 

Can I work with the embedded content, or other feature, to lock these placeholders/variables using reg ex?

 

Please advise ASAP

 

BR

Fouad

Parents
  • If I would be you, I would tell the client to send some sensible and localization-friendly format.
    This crappy construct apparently assumes that translator is also a JavaScript programmer and is able to evaluate the conditionals embedded inside the sentences in order to understand the intended meaning of the sentence :(.
    While you should be pretty easily able to get the {{blabla}} placeholders into a proper inline tags, it won't help you neither with the embedded HTML code, nor with the embedded conditions (which, depending on the target language's grammar and the sentence's complexity, may mean to completely reorder the entire text, including the conditions).

Reply
  • If I would be you, I would tell the client to send some sensible and localization-friendly format.
    This crappy construct apparently assumes that translator is also a JavaScript programmer and is able to evaluate the conditionals embedded inside the sentences in order to understand the intended meaning of the sentence :(.
    While you should be pretty easily able to get the {{blabla}} placeholders into a proper inline tags, it won't help you neither with the embedded HTML code, nor with the embedded conditions (which, depending on the target language's grammar and the sentence's complexity, may mean to completely reorder the entire text, including the conditions).

Children