Answer the question
In order to leave comments, you need to log in
How to do localization at the template level?
Hello. Now the localization of the interface is done like this
template -> ru = interface in Russian
->uk = interface in Ukrainian
->br = interface in Brazilian
Somewhere they write that each phrase must be passed to the template using an array (some write constants or variables)
Now in my head thoughts are spinning about parsing the template, processing it with regular expressions and entering the finished template into a radish. Then the template is already pushed into html/template.
The processing of regular expressions will be something like this
In the template on disk, for example, we have %%in1%%
regular expression %%in1%%, replace it with the desired phrase (taking into account localization)
Phrases for replacement will be stored like this
map[string]string {
"%%in1%%" : "welcome",
"%%in2%%" : "exit",
"{{hello}}" : "Hi"
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question