godot: Failed loading localization resource

Bugsquad edit: As of 3.2-stable, the issue is mostly a usability problem as described in https://github.com/godotengine/godot/issues/10677#issuecomment-466353021

Test project available in https://github.com/godotengine/godot/issues/10677#issuecomment-333881583


a6e37ae commit from master, Linux Mint XFCE 18.2.

  1. I make simple CSV file: image
  2. Set test language to ru (which contains in CSV file too) and fallback lang to en in project settings.
  3. Import CSV in Localization tab.
  4. Make a node with label with text LANGUAGE_NAME.
  5. Run this scene: image
  6. ???
  7. Localization just not loaded: image

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 33 (19 by maintainers)

Most upvoted comments

No… must use , instead of ; Check the demo in the demos zip

On Aug 26, 2017 10:16 PM, “Maxim Lebedev” notifications@github.com wrote:

This is right format?

id;ar;bg;zh-CN;zh-TW;cs;da;nl;en;fi;fr;de;el;hu;it;ja;ko;no;pl;pt;pt-BR;ro;ru;es;sv;th;tr;uk LANGUAGE_NAME;العربية;български език;简体中文;繁體中文;čeština;Dansk;Nederlands;English;Suomi;Français;Deutsch;Ελληνικά;Magyar;Italiano;日本語;한국어;Norsk;Polski; Português;Português-Brasil;Română;Русский;Español;Svenska;ไทย;Türkçe;Українська

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/10677#issuecomment-325170933, or mute the thread https://github.com/notifications/unsubscribe-auth/AF-Z27JmL7U_OSJrBl5F-KCFD0-jCqWMks5scMODgaJpZM4PDqsz .

  1. Use _ in locale names, not -.
  2. no is not a valid locale. use nn or nn_NO
  3. CSV Importer will generate a bunch of *.translation files, use them in Project Settings > Translation, not *.csv. (The editor should be fixed so it does this automatically IMO.)

@reduz,

I would propose two modifications.

First:

Not every import file has a path attribute, and when it does not i think it means that it is not a loadable resource. So we could make this distinction adding a error saying that the file is not loadable if the path is empty.But It could be a problem for other files. Another possibility is add a new attribute saying if the file should be loaded or not.

//current code
if (r_path_and_type.path == String() || r_path_and_type.type == String()) {
	return ERR_FILE_CORRUPT;
}

//modified code version 1
if (r_path_and_type.path == String() || r_path_and_type.type == String()) {
	return ERR_FILE_NOT_LOADABLE;
}

//modified code version 2
if (!r_path_and_type.loadable)){
	return ERR_FILE_NOT_LOADABLE;
}
else if (r_path_and_type.path == String() || r_path_and_type.type == String()) {
	return ERR_FILE_CORRUPT;
}

Second:

In the “Project Settings > Localization > Translations” menu when some one add a csv file, it can try to read the csv.import file and grab the references to the translation files from there.

If you agree I can submit a PR with this modifications.

Here is a minimal example for testing in Godot 3: test-translation.zip (Still not working for me: Linux 64bits, Antergos distrib - Arch based, same build).

Thanks for your work!