Comments (15)
I cannot think any other step to add, great work! I believe that a lot of lines will be changed, so probably breaking this issue into some PRs will make it easier to review. Thanks @kedMertens
from send2kindlebot.
@kedMertens
Should we provide possibility to manually switch between languages?
In my opinion, no.
- I believe it is better to the user if the bot changes automatically. I want to make it easy to the user. I like to have the least buttons/commands as possible
- Doing it automatically, as it is now, I don't have to change the database. hehe
After merging the PR we can start to expand i18n folder with different languages.
Perfect! I did the changes as a test. After all, I would like to get opinions before merging it.
Also I liked the method because it works automatically when a new language is added. There is no need to change the code.
from send2kindlebot.
This is a great guide on how to handle i18n in Python. It basically covers this part of Python docs (https://docs.python.org/3/library/i18n.html).
from send2kindlebot.
@GabrielRF, @rougeth, here is what I found out.
In order to provide multi-language feature following steps has to be applied :
- Wrap desired strings from pdftokindlebot.py with
_()
, that mark will highlight text for next step. - Generate Portable Object Template (POT) file, the file will contain all marked strings. To generate one, several tools are available: xgettext, xpot, standard python script pygettext.py and Babel library.
- Add translations of the text to POT file and generate Portable Object (PO), Machine Object (MO) files. Filling POT file can be done manually or with help of third party services, for instance Transifex - provides translation and generates PO, MO files, open-source translations editor is Poedit , Babel library methods.
- Add gettext module to pdftokindlebot.py.
- Modify source-code to enable translation options based on user language_code or with bot commands to change language on fly.
I can open a PR and start to work with respect to revealed algorithm.
Will be glade to hear your feedback.
from send2kindlebot.
@kedMertens I was adding labels as you answered here. hehe
Maybe I could make some documented steps in order to provide guidance to new contributors on how to wrap translation?
Can you do that? It would be awesome!
@GabrielRF will try my best.
We can create a CONTRIBUTING.md and provide guidelines for the translation issues there.
from send2kindlebot.
Hi, @GabrielRF !
I would like to contribute in your project.
In frame of the issue, I could add French and Russian as options.
What do you think?
from send2kindlebot.
Hi, @kedMertens
It would be nice!!
I'm not familiar with the best way to prepare the file to be translated. Are you experienced with it?
from send2kindlebot.
Hi, @kedMertens
It would be nice!!I'm not familiar with the best way to prepare the file to be translated. Are you experienced with it?
No, I will investigate the question and propose options, which we could discuss.
from send2kindlebot.
This is a great guide on how to handle i18n in Python. It basically covers this part of Python docs (https://docs.python.org/3/library/i18n.html).
Thanks for the links. I'll start to work from here.
from send2kindlebot.
I've studied a little and found a library to help translating the messages.
Here is a first attempt https://github.com/GabrielRF/Send2KindleBot/tree/i18n
I'm not familiar with i18n.. But I liked this method because it's very simple.
What do you @rougeth and @kedMertens think?
from send2kindlebot.
I've studied a little and found a library to help translating the messages.
Here is a first attempt https://github.com/GabrielRF/Send2KindleBot/tree/i18nI'm not familiar with i18n.. But I liked this method because it's very simple.
What do you @rougeth and @kedMertens think?
@GabrielRF , liked it! Looks pretty much as implementation of gettext module.
After merging the PR we can start to expand i18n folder with different languages.
Should we provide possibility to manually switch between languages?
I would love to work on both.
from send2kindlebot.
To make the repo organized, i'm closing this issue and opened one for each language.
from send2kindlebot.
@GabrielRF, I would like to propose to add to all issues that you have created recently hacktoberfest tag.
It is open source celebrating event, which is going on right now on github, here is a link. I believe that it is great opportunity to get attention from native speakers to contribute to translation issues) With that tag repository of the project will appear in official web-page. Here is some tips from it
from send2kindlebot.
I'm planning to make Russian one today. Maybe I could make some documented steps in order to provide guidance to new contributors on how to wrap translation?
@GabrielRF, @rougeth what do you think?
from send2kindlebot.
@kedMertens I was adding labels as you answered here. hehe
Maybe I could make some documented steps in order to provide guidance to new contributors on how to wrap translation?
Can you do that? It would be awesome!
from send2kindlebot.
Related Issues (20)
- Translate string `slowmode` to ur-en HOT 2
- Translate string `slowmodesec` to ur-en HOT 2
- Translate `slowmode` to zh-hant-tw HOT 2
- Translate `slowmodesec` to zh-hant-tw HOT 2
- Please support @kindle.cn email HOT 2
- Translate bot to Tamil Language HOT 1
- Translate `slowmodesec` to ta
- Translate `slowmode` to ta HOT 1
- Translate bot to Telugu Language HOT 1
- Translate bot to Kannada language HOT 1
- Translate bot to Japanese Language HOT 1
- Translate `slowmode` to te HOT 1
- Translate `slowmodesec` to te HOT 1
- Translate `slowmode` to kn HOT 1
- Translate `slowmodesec` to kn HOT 1
- Disregard HOT 1
- Can't find setting to change 'Sender Email' HOT 3
- Problem with non ASCII filenames
- Max Upload size HOT 3
- Unregister email HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from send2kindlebot.