S
S
Shandy2021-09-30 16:28:35
Python
Shandy, 2021-09-30 16:28:35

How to localize an application?

Depending on the settings, it is necessary to output a string in different languages ​​(English/Ukrainian/Russian). I asked my friends and drew 2 options:

  1. Use a file .pywith constants. for exampletranslation.EN_CREATE_BUTTON
  2. Use the configparser library and take a line from there. for exampletranslation["EN"]["create_button"]

Maybe there are other options? We need the opinion of knowledgeable people
upd. You still need to format the strings somehow. for exampleDelete {user} account

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2021-09-30
@fox_12

Why didn't you like this option?:
gettext - Multilingual internationalization services

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question