transifex / transifex-client

The Transifex command-line tool.
https://www.transifex.com/
GNU General Public License v2.0
135 stars 75 forks source link

Slugs are backslashes on Windows instead of underscore #291

Open Daltz333 opened 4 years ago

Daltz333 commented 4 years ago

This breaks compatibility with UNIX/Linux machines when working on a cross-platform project.

Daltz333 commented 4 years ago

Example Transifex Client config on MacOS

[main]
host = https://www.transifex.com
lang_map = es_MX: es, fr_CA: fr, he_IL: he, tr_TR: tr

[frc-docs.build_gettext_404]
file_filter = source/locale/<lang>/LC_MESSAGES/404.po
source_file = build/gettext/404.pot
source_lang = en
type = PO

Example when running tx config on Windows

[frc-docs.build_gettext\docs\software\wpilib-tools\smartdashboard\test-mode-and-live-window\pid-tuning-with-smartdashboard]
file_filter = source/locale/<lang>/LC_MESSAGES/docs/software/wpilib-tools/smartdashboard/test-mode-and-live-window/pid-tuning-with-smartdashboard.po
source_file = build/gettext/docs/software/wpilib-tools/smartdashboard/test-mode-and-live-window/pid-tuning-with-smartdashboard.pot
source_lang = en
type = PO
Daltz333 commented 4 years ago

This may be a bug in the underlying python-slugify project? Either way it's quite problematic.

pankav commented 4 years ago

Hello @Daltz333 ,

Thank you for your reply. Could you please describe how did you achieve to create the following tx config file in windows?

[frc-docs.build_gettext\docs\software\wpilib-tools\smartdashboard\test-mode-and-live-window\pid-tuning-with-smartdashboard] file_filter = source/locale/<lang>/LC_MESSAGES/docs/software/wpilib-tools/smartdashboard/test-mode-and-live-window/pid-tuning-with-smartdashboard.po source_file = build/gettext/docs/software/wpilib-tools/smartdashboard/test-mode-and-live-window/pid-tuning-with-smartdashboard.pot source_lang = en type = PO

Also, could you please explain why it is necessary to include the backslash character \ in the resource name?

Thank you in advance, Panagiotis

Daltz333 commented 4 years ago

I ran the following command on my windows machine tx config mapping-bulk --project frc-docs --file-extension '.pot' --source-file-dir build/gettext --source-lang en --type PO --expression 'source/locale/<lang>/LC_MESSAGES/{filepath}/{filename}.po' --execute

Daltz333 commented 4 years ago

It shouldn't be necessary, we don't want backslashes at all. This was auto-generated, and when running the command on UNIX vs Windows, we get two duplicate resources because of this.

pankav commented 4 years ago

Hi @Daltz333 , Thank you for your feedback. I would like to inform you that for the time being what you are looking for is not supported. However, I will forward your request to our engineers to see how this can be addressed on our end. Once I have an update on this I will let you know.

Kind regards, Panagiotis

diegobz commented 4 years ago

@Daltz333 Could you try forcing an upgrade of python-slugify to its latest 4.x version and tell us if the issue persists, please?

Daltz333 commented 4 years ago

My machine is currently being upgraded and new parts come Thursday so I can hopefully check then

diegobz commented 4 years ago

@Daltz333 0.13.10 just got released which bumps the version of python-slugify. Let us know if the problem is still happening on Windows for you.