Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
1 of 3 tasks
AbdElhalim12 opened this issue Sep 15, 2024 · 9 comments
Open
1 of 3 tasks
Labels
bug Something isn't working

Comments

@AbdElhalim12
Copy link

Is there an existing issue for this problem?

  • I have searched the existing issues

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

  • Log file
  • Project file

Anything else?

No response

@AbdElhalim12 AbdElhalim12 added the bug Something isn't working label Sep 15, 2024
@Noisyfox
Copy link
Collaborator

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

@AbdElhalim12
Copy link
Author

#6815

@Noisyfox
Copy link
Collaborator

The reason it doesn't work is this:

if (language_info != nullptr && language_info->LayoutDirection == wxLayout_RightToLeft) {
BOOST_LOG_TRIVIAL(trace) << boost::format("The following language code requires right to left layout, which is not supported by OrcaSlicer: %1%") % language_info->CanonicalName.ToUTF8().data();
language_info = nullptr;
}

@AbdElhalim12
Copy link
Author

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

@Noisyfox
Copy link
Collaborator

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
Copy link
Author

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

@Noisyfox
Copy link
Collaborator

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

@AbdElhalim12
Copy link
Author

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

@Noisyfox
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants