IFRCGo / go-api

MIT License
14 stars 6 forks source link

Translation: Validate, flag and filter out strings where the template string variable is changed #2082

Open samshara opened 8 months ago

samshara commented 8 months ago

Tasks

Orginal string: Cycle {cycle}: {countryName} PER process Erroneous strings : Ciclo {ciclo}: proceso PER de {nombrePaís} Correct strings: Ciclo {cycle}: proceso PER de {countryName}

feedback from @steph-gm:

Staging - General Country pages: National Society Overview - Capacity • Cycle number or description is not appearing in the boxes in Spanish

Originally posted by @tovari in https://github.com/IFRCGo/go-web-app/issues/340#issuecomment-2020753197

thenav56 commented 8 months ago

@tnagorra to provide regex for validation

tnagorra commented 7 months ago

We can use something like this

'My {sub} is {obj}'.match(/\{(\w+)\}/g)

image