BadrIT / translation_center

Translation Center is a multi-lingual, GUI rich, community based, translation center for Rails apps
http://www.badrit.com/gems/translation_center/
MIT License
152 stars 71 forks source link

Special symbols not allowed? colons, trailing whitespaces, starting quotation marks... #76

Open srteyo opened 8 years ago

srteyo commented 8 years ago

Hi BADR team!

we're delighted with this tool, it has boosted our translation speed by a long shot, but we've run into a really weird issue: it would seem the translations are not escaped when stored in the DB.

What I mean is, I can add News but not News:, nor "News" as a translation. Same thing happens with leading and trailing whitespaces, leading quotation marks...

This forces us to modify these entries manually after exporting them to YAML, which beats the purpose of the TC. Here you are a sequence of screenshots for improved clarity:

What we want to save: captura de pantalla de 2016-05-04 12 19 16

What is saved instead: captura de pantalla de 2016-05-04 12 19 28

What is actually displayed: captura de pantalla de 2016-05-04 12 19 51

Are we missing something? Is there something we're doing terribly wrong? If that's not the case, is it a bug, a missing feature?

Thank you again for this great gem, keep up the good work! Sergio

IslamAzab commented 8 years ago

@helsayed Check this.

srteyo commented 8 years ago

In this line

params[:value].strip # => "Board:"

but

YAML.load(params[:value].strip) # => {"Board"=>nil}

so it would appear that YAML.load is the culprit, but why is this happening?

Thanks! Sergio