Code Monkey home page Code Monkey logo

Comments (15)

rougeth avatar rougeth commented on August 26, 2024 3

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.

GabrielRF avatar GabrielRF commented on August 26, 2024 2

@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.

rougeth avatar rougeth commented on August 26, 2024 1

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.

kedMertens avatar kedMertens commented on August 26, 2024 1

@GabrielRF, @rougeth, here is what I found out.
In order to provide multi-language feature following steps has to be applied :

  1. Wrap desired strings from pdftokindlebot.py with _() , that mark will highlight text for next step.
  2. 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.
  3. 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.
  4. Add gettext module to pdftokindlebot.py.
  5. 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 avatar kedMertens commented on August 26, 2024 1

@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.

kedMertens avatar kedMertens commented on August 26, 2024

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.

GabrielRF avatar GabrielRF commented on August 26, 2024

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.

kedMertens avatar kedMertens commented on August 26, 2024

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.

kedMertens avatar kedMertens commented on August 26, 2024

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.

GabrielRF avatar GabrielRF commented on August 26, 2024

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.

kedMertens avatar kedMertens commented on August 26, 2024

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?

@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.

GabrielRF avatar GabrielRF commented on August 26, 2024

To make the repo organized, i'm closing this issue and opened one for each language.

from send2kindlebot.

kedMertens avatar kedMertens commented on August 26, 2024

@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
image

from send2kindlebot.

kedMertens avatar kedMertens commented on August 26, 2024

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.

GabrielRF avatar GabrielRF commented on August 26, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.