Translator refactoring

Forum for developers

Translator refactoring

Beitragvon luc » Mo Sep 07, 2015 8:01 pm

Hello, last weeks I began working on french translation files and to my opinion there is a big issue in the Translator system that could be quite easily improved : the fact that keys in '.lng' locale files are processed as regular expressions. For a non developer and indeed for everyone its quite annoying and error prone : each time a label to translate contains one of the characters used to build regular expressions (like (, {, *...) it have to be escaped or strange behavior may occur during translator processing. Looking deeply at locale files, it seems that true regular expressions are not used.
So I plan to replace regular expression processing in Translator class by simple string search/replace and to remove escape chars in locale files. I will validate this by generating translated files and making diff with old files.
Do you agree with the idea? Or maybe I missed something?
Beiträge: 294
Registriert: Mi Aug 26, 2015 1:04 am

Zurück zu YaCy Coding & Architecture

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast