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

Cannot use localized resx files in exported game #43277

Open
xill47 opened this issue Nov 2, 2020 · 11 comments
Open

Cannot use localized resx files in exported game #43277

xill47 opened this issue Nov 2, 2020 · 11 comments

Comments

@xill47
Copy link
Contributor

xill47 commented Nov 2, 2020

Godot version: 3.2.3.stable.mono

OS/device including version: Windows 10 2004 (also tested in Ubuntu VM)

Issue description:

When I use .resx file and its localized counterpart, I am getting the right string (ResourceManager respects CultureInfo.CurrentCulture) when running the game from Godot Editor, but string fallbacks to the default (unlocalized one) when running exported project.

Probably relevant: mono/mono#19928
Mentioned workaround doesn't work in exported project since all assemblies seem to be packed into .pck file.

Steps to reproduce:

  1. Create Mono project
  2. Add resx file
  3. Add localized resx file
  4. Export project with default Windows or Linux template

Minimal reproduction project:

ResxLocalizationProblemMinimum.zip

@Calinou
Copy link
Member

Calinou commented Nov 2, 2020

Out of curiosity, why not use Godot's built-in localization system instead of .resx files? It supports both the CSV and gettext formats.

@xill47
Copy link
Contributor Author

xill47 commented Nov 2, 2020

That's what I am probably going to do, but it was just out of old habit. Still need to find comfortable tooling to use with gettext (csv will just become too cluttered if there will be additional translations).

@akien-mga
Copy link
Member

Do you add *.resx files in your export filter to ensure they get included in the PCK? Godot by default only exports known resources, and doesn't know about *.resx.

That's what I am probably going to do, but it was just out of old habit. Still need to find comfortable tooling to use with gettext (csv will just become too cluttered if there will be additional translations).

You can use PO files with Godot's Translation resource.

@xill47
Copy link
Contributor Author

xill47 commented Nov 2, 2020

@akien-mga
Both .NET and Mono compile .resx files down to .dll files (I can find them inside .mono\temp\bin\Debug\{lang id} in Godot project) so it doesn't seem necessary. I tried anyway, it didn't make any difference.

I understand that I can use Godot's Translation resource, I am just looking for a convenient way to generate PO templates and edit translations. (For future reference or anyone who will find it with similar problem: I will probably create .txt file with strings, use txt2po from translate-toolkit package and then Poedit as recommended in Godot Documentation, or similar alternative)

@akien-mga
Copy link
Member

You might be interested in @SkyLucilfer's GSoC work: #39415
It's for Godot 4.0 though.

I'm not familiar with the .NET translation workflow but we probably need to support it independently of Godot's own features. @neikeq might know more about this.

@neikeq neikeq self-assigned this Nov 3, 2020
@neikeq neikeq added the bug label Nov 3, 2020
@neikeq neikeq added this to the 4.0 milestone Nov 3, 2020
@object71
Copy link
Contributor

It could work pretty easily - in the minimum project you provided after build you can find the compiled resources in:
ResxLocalizationProblemMinimum/.mono/temp/bin/Debug

There will be a "ru" folder in your case. Copy that ru folder to the exported project location as in:
image

@object71
Copy link
Contributor

I will take a look if the folder can be included in the export process

@Calinou
Copy link
Member

Calinou commented Nov 18, 2021

I will take a look if the folder can be included in the export process

@object71 Bump 🙂 Did you manage to do this?

@object71
Copy link
Contributor

Considering I wrote it an year ago we can safely assume I forgot about it.

@markdibarry
Copy link
Contributor

Any news on this front? Would be super cool to have type-safe resource strings supported with Godot.

@raulsntos raulsntos moved this to To Assess in 4.x Priority Issues Nov 21, 2022
@raulsntos raulsntos moved this from To Assess to Todo in 4.x Priority Issues Nov 21, 2022
@RedworkDE
Copy link
Member

This was fixed on 4.0, tho the issue likely remains on 3.x.

@akien-mga akien-mga modified the milestones: 4.0, 3.x Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants