- Mailing Lists
- Contributors
- Introducing pofiletranslate – A Tool for Translating PO Files
Archives
- By thread 1419
-
By date
- August 2019 59
- September 2019 118
- October 2019 165
- November 2019 97
- December 2019 35
- January 2020 58
- February 2020 204
- March 2020 121
- April 2020 172
- May 2020 50
- June 2020 158
- July 2020 85
- August 2020 94
- September 2020 193
- October 2020 277
- November 2020 100
- December 2020 159
- January 2021 38
- February 2021 87
- March 2021 146
- April 2021 73
- May 2021 90
- June 2021 86
- July 2021 123
- August 2021 50
- September 2021 68
- October 2021 66
- November 2021 74
- December 2021 75
- January 2022 98
- February 2022 77
- March 2022 68
- April 2022 31
- May 2022 59
- June 2022 87
- July 2022 141
- August 2022 38
- September 2022 73
- October 2022 152
- November 2022 39
- December 2022 50
- January 2023 93
- February 2023 49
- March 2023 106
- April 2023 47
- May 2023 69
- June 2023 92
- July 2023 64
- August 2023 103
- September 2023 91
- October 2023 101
- November 2023 94
- December 2023 46
- January 2024 75
- February 2024 79
- March 2024 104
- April 2024 63
- May 2024 40
- June 2024 160
- July 2024 80
- August 2024 70
- September 2024 62
- October 2024 121
- November 2024 117
- December 2024 89
- January 2025 59
- February 2025 104
- March 2025 96
- April 2025 107
- May 2025 52
- June 2025 72
- July 2025 60
- August 2025 81
- September 2025 124
- October 2025 63
- November 2025 22
Contributors
Introducing pofiletranslate – A Tool for Translating PO Files
Dear Odoo Community,
I’ve developed a straightforward tool to translate PO files directly from a local codebase. I noticed that translations often follow a pattern within each project, and leveraging existing translations tends to produce better results than relying on Google Translate or AI-based tools.
**PyPI:** [https://pypi.org/project/pofiletranslate/](https://pypi.org/project/pofiletranslate/)
**GitHub:** [https://github.com/RachidAlassir/po-translate](https://github.com/RachidAlassir/po-translate)
I’d love to hear your feedback and suggestions!
Best regards,
Rachid Alassir
by Rachid Alassir - 08:45 - 11 Mar 2025
Follow-Ups
-
Re: Introducing pofiletranslate – A Tool for Translating PO Files
Hi Tom,
Thank you for sharing your approach!
My tool is designed to be straightforward for anyone structuring their codebase in a workspace. You simply open the terminal in the
i18nfolder and run:pofiletranslate lang.poI've considered adding a caching system to avoid re-scanning PO files and integrating AI models (like transformer-based ones from Hugging Face) for the remaining untranslated terms. However, I found that this would complicate the tool while offering diminishing returns.
Let me know if you have any thoughts!
Best regards,
RachidLe mer. 12 mars 2025 à 13:17, Tom Blauwendraat <notifications@odoo-community.org> a écrit :Hi Rachid,
I don't really have the time to take a look at what you made, but I've been using standard tools and some scripting to achieve the same, revolving around the following commands:
1. Create "compendium" from existing translations:
find ../../odoo -name nl.po | xargs msgcat --use-first | msgattrib --translated --no-fuzzy -o $HOME/odoo_nl.po
2. Translate a module's PO file, making use of the compendium:
msgmerge --no-fuzzy-matching --compendium $HOME/odoo_nl.po -o $dir/$module.new.po /dev/null $dir/$module.po
It seems a similar method. I don't know if it can be of use to you
-Tom
On 3/12/25 12:37, Rachid Alassir wrote:
Hi Antonio,
By codebase, I mean the root directory of your workspace where your source code and existing translation files are located. The package searches for translations by analyzing the
.pofiles in your project and reusing existing translations instead of relying on AI or Google Translate.By default, the tool starts from the directory of the provided
.pofile and backtracks up to 4 levels (configurable with--depth) to identify common translations within your project.Here’s an example to illustrate how it works:
workspace17/ ├── hr/ # HR-related modules ├── account/ # Accounting-related modules │ ├── my_module/ # Your custom module │ │ ├── i18n/ # Translation folder │ │ │ ├── fr.po # French translation file (target file for translation)If you run:
pofiletranslate account/my_module/i18n/fr.poThe tool will search for translations in fr
.pofiles up to 4 levels above in your workspace (workspace17/), ensuring better translation consistency across your project.Let me know if you need any further clarification!
Best regards,
Rachid
Le mer. 12 mars 2025 à 12:13, Antonio M. Vigliotti <notifications@odoo-community.org> a écrit :
Hi Rachid,
it is very interesting but what do you mean for Codebase?
I cannot understand where package search for tranlsation.
Thanks
Il 11/03/2025 21:23, Rachid Alassir ha scritto:
I apologize for the incorrectly formatted URLs in my previous email. Here are the correct links:
On Tue, Mar 11, 2025, 8:39 PM Rachid Alassir <rachidalassir@gmail.com> wrote:
Dear Odoo Community,
I’ve developed a straightforward tool to translate PO files directly from a local codebase. I noticed that translations often follow a pattern within each project, and leveraging existing translations tends to produce better results than relying on Google Translate or AI-based tools.
**PyPI:** [https://pypi.org/project/pofiletranslate/](https://pypi.org/project/pofiletranslate/)
**GitHub:** [https://github.com/RachidAlassir/po-translate](https://github.com/RachidAlassir/po-translate)
I’d love to hear your feedback and suggestions!
Best regards,
Rachid Alassir_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
by Rachid Alassir - 11:11 - 13 Mar 2025 -
Re: Introducing pofiletranslate – A Tool for Translating PO Files
Hello Rachid,
very nice, especially for custom modules. Thanks a lot.
BR Goran
11.03.2025 20:47:03 Rachid Alassir <notifications@odoo-community.org>:
Dear Odoo Community,
I’ve developed a straightforward tool to translate PO files directly from a local codebase. I noticed that translations often follow a pattern within each project, and leveraging existing translations tends to produce better results than relying on Google Translate or AI-based tools.
**PyPI:** [https://pypi.org/project/pofiletranslate/](https://pypi.org/project/pofiletranslate/)
**GitHub:** [https://github.com/RachidAlassir/po-translate](https://github.com/RachidAlassir/po-translate)
I’d love to hear your feedback and suggestions!
Best regards,
Rachid Alassir_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
by Goran Sunjka - 09:56 - 13 Mar 2025 -
Re: Introducing pofiletranslate – A Tool for Translating PO Files
Thank Rachid.
I would try both your solution both the msgmerge solution.
Thanks to all
Il 11/03/2025 20:46, Rachid Alassir ha scritto:
Dear Odoo Community,
I’ve developed a straightforward tool to translate PO files directly from a local codebase. I noticed that translations often follow a pattern within each project, and leveraging existing translations tends to produce better results than relying on Google Translate or AI-based tools.
**PyPI:** [https://pypi.org/project/pofiletranslate/](https://pypi.org/project/pofiletranslate/)
**GitHub:** [https://github.com/RachidAlassir/po-translate](https://github.com/RachidAlassir/po-translate)
I’d love to hear your feedback and suggestions!
Best regards,
Rachid Alassir_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
by Antonio M. Vigliotti - 02:41 - 12 Mar 2025 -
Re: Introducing pofiletranslate – A Tool for Translating PO Files
I load the translation memory of POEdit feeding it with the existing .po files, and then open the PO to translate and auto-feeding it.Regards.
by Pedro M. Baeza - 01:21 - 12 Mar 2025 -
Re: Introducing pofiletranslate – A Tool for Translating PO Files
Hi Rachid,
I don't really have the time to take a look at what you made, but I've been using standard tools and some scripting to achieve the same, revolving around the following commands:
1. Create "compendium" from existing translations:
find ../../odoo -name nl.po | xargs msgcat --use-first | msgattrib --translated --no-fuzzy -o $HOME/odoo_nl.po
2. Translate a module's PO file, making use of the compendium:
msgmerge --no-fuzzy-matching --compendium $HOME/odoo_nl.po -o $dir/$module.new.po /dev/null $dir/$module.po
It seems a similar method. I don't know if it can be of use to you
-Tom
On 3/12/25 12:37, Rachid Alassir wrote:
Hi Antonio,
By codebase, I mean the root directory of your workspace where your source code and existing translation files are located. The package searches for translations by analyzing the
.pofiles in your project and reusing existing translations instead of relying on AI or Google Translate.By default, the tool starts from the directory of the provided
.pofile and backtracks up to 4 levels (configurable with--depth) to identify common translations within your project.Here’s an example to illustrate how it works:
workspace17/ ├── hr/ # HR-related modules ├── account/ # Accounting-related modules │ ├── my_module/ # Your custom module │ │ ├── i18n/ # Translation folder │ │ │ ├── fr.po # French translation file (target file for translation)If you run:
pofiletranslate account/my_module/i18n/fr.poThe tool will search for translations in fr
.pofiles up to 4 levels above in your workspace (workspace17/), ensuring better translation consistency across your project.Let me know if you need any further clarification!
Best regards,
Rachid
Le mer. 12 mars 2025 à 12:13, Antonio M. Vigliotti <notifications@odoo-community.org> a écrit :
Hi Rachid,
it is very interesting but what do you mean for Codebase?
I cannot understand where package search for tranlsation.
Thanks
Il 11/03/2025 21:23, Rachid Alassir ha scritto:
I apologize for the incorrectly formatted URLs in my previous email. Here are the correct links:
On Tue, Mar 11, 2025, 8:39 PM Rachid Alassir <rachidalassir@gmail.com> wrote:
Dear Odoo Community,
I’ve developed a straightforward tool to translate PO files directly from a local codebase. I noticed that translations often follow a pattern within each project, and leveraging existing translations tends to produce better results than relying on Google Translate or AI-based tools.
**PyPI:** [https://pypi.org/project/pofiletranslate/](https://pypi.org/project/pofiletranslate/)
**GitHub:** [https://github.com/RachidAlassir/po-translate](https://github.com/RachidAlassir/po-translate)
I’d love to hear your feedback and suggestions!
Best regards,
Rachid Alassir_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
_______________________________________________
Mailing-List: https://odoo-community.org/groups/contributors-15
Post to: mailto:contributors@odoo-community.org
Unsubscribe: https://odoo-community.org/groups?unsubscribe
by Tom Blauwendraat - 01:16 - 12 Mar 2025