tomdionysus / foaas

FOAAS (Fuck Off As A Service) provides a modern, RESTful, scalable solution to the common problem of telling people to fuck off.
http://foaas.com
Do What The F*ck You Want To Public License
2.99k stars 394 forks source link

i18n: punctuation not preserved for some languages, "subtitle" becomes undefined #145

Closed mateon1 closed 6 years ago

mateon1 commented 8 years ago

The separator made of punctuation gets broken for some languages (tested: i18n=es and i18n=pl) As an example: http://www.foaas.com/you/Tom/Everyone?i18n=es, returns

{"message": "Jódete, Tom. !!,., !! - Todo el mundo ", "subtitle": " undefined"}
gerardolm commented 7 years ago

This is due to the "separator" variable as defined in the file foaas/lib/filters/i18n.coffee as "!!,.,!!"

I guess this separator is used to translate the message and subtitle in a single request. However, the translation service adds proper spaces to punctuation, so "!!,.,!!" becomes something else, and is thus not properly parsed in the response by the i18n filter.

tomdionysus commented 6 years ago

Same issue as #199 - translator service is a bit shit anyway and I should probably drop it