Closed radhay-samagra closed 2 years ago
/i18n
{ "meta": {}, "bodyI18n": { "createMany": { "data": [ { "lang": "en", "body": "Hello World. This is ${name}. I love (to) ${task}" }, { "lang": "hindi", "body": "Hello World. This is ${name}. I love (to) ${task}" } ] } }, "type": "JS_TEMPLATE_LITERALS", "user": "25bbdbf7-5286-4b85-a03c-c53d1d990a23" }
/i18n/process
{ "id": 5, "data": { "lang": "en", "name": "Chakshu", "task": "shave yaks" } }
{ "processed": "Hello World. This is Chakshu. I love (to) shave yaks", "templateType": "JS_TEMPLATE_LITERALS", "data": { "lang": "en", "name": "Chakshu", "task": "shave yaks" }, "template": "test", "meta": {} }
{ "processed": [ { "lang": "en", "processed": "Hello World. This is Chakshu. I love (to) shave yaks" }, { "lang": "hindi", "processed": "Hello World. This is Chakshu. I love (to) shave yaks" } ], "templateType": "JS_TEMPLATE_LITERALS", "data": { "name": "Chakshu", "task": "shave yaks" }, "template": "test", "meta": {} }
@radhay-samagra please update the spec to include ISO language codes.
@ChakshuGautam Added the ISO Language Codes for lang property
lang
Create Request Body
POST
/i18n
Render Request Body
POST
/i18n/process
Render Response Body
If lang provided, then only the provided lang will be rendered
If lang not provided in body