SoftFever / OrcaSlicer

G-code generator for 3D printers (Bambu, Prusa, Voron, VzBot, RatRig, Creality, etc.)
https://discord.gg/P4VE9UY9gJ
GNU Affero General Public License v3.0
6.73k stars 789 forks source link

New Language appear in the drop down in preferences but doesn't work #6771

Open AbdElhalim12 opened 1 week ago

AbdElhalim12 commented 1 week ago

Is there an existing issue for this problem?

OrcaSlicer Version

2.2.0

Operating System (OS)

Windows

OS Version

windows 11

Additional system information

No response

Printer

all

How to reproduce

create new language and add the mo file to i18n folder

Actual results

I followed the localization wiki page to create a new language that doesn't exist in orcaslicer, then I modified the preferences.cpp file to add add it. The Language now appears in the dropdown in preferences window but when I choose it the orcaslicer needs to be restarted as normal but after restart the language still English. I tried to move the mo file to the en folder to test whether it works or not, and it appears correctly.

Expected results

new language should take over the UI

Project file & Debug log uploads

image image

Checklist of files to include

Anything else?

No response

Noisyfox commented 5 days ago

You could try raising a draft PR so I could take a better look at what you've got so far.

AbdElhalim12 commented 3 days ago

https://github.com/SoftFever/OrcaSlicer/pull/6815

Noisyfox commented 3 days ago

The reason it doesn't work is this: https://github.com/SoftFever/OrcaSlicer/blob/587e83939777b44c13ca26223fbb3ffe6b2e6863/src/slic3r/GUI/GUI_App.cpp#L5091-L5094

AbdElhalim12 commented 3 days ago

but when I replace the english mo file with the arabic one to test it, it worked image

Noisyfox commented 3 days ago

but when I replace the english mo file with the arabic one to test it, it worked image

Because in that case the app believes it's English not Arabic, which bypassed this check.

AbdElhalim12 commented 3 days ago

Okaaay, So it there a way to exclude Arabic from that condition, since it's working correctly?

Noisyfox commented 3 days ago

You can just change the line I mentioned above, (or even delete that check)

AbdElhalim12 commented 20 hours ago

Hey, Ive tried couple things but all I got is the whole UI turned Right to left image image

Noisyfox commented 7 hours ago

Ah... I guess that's how wxwidgets handles right-to-left languages.