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

CSV translation file cannot be imported properly #87187

Closed
ypp666666 opened this issue Jan 14, 2024 · 4 comments · Fixed by #97222
Closed

CSV translation file cannot be imported properly #87187

ypp666666 opened this issue Jan 14, 2024 · 4 comments · Fixed by #97222

Comments

@ypp666666
Copy link

Tested versions

The bug appeared in stable version 4.2.1, my simple project, for testing translation functionality. Initially, the CSV file was able to be imported and recognized normally, and I was able to print the correct translation results. But when I ran it again today, it started reporting errors. It prompts me,"E 0:00:00:0631 _load: Failed loading resource: res://888/666689988.csv. Make sure resources have been imported by opening the project in the editor at least once."

System information

windows 11 5600g p106

Issue description

The bug appeared in stable version 4.2.1, my simple project, for testing translation functionality. Initially, the CSV file was able to be imported and recognized normally, and I was able to print the correct translation results. But when I ran it again today, it started reporting errors. It prompts me," _load: Failed loading resource: res://888/666689988.csv. Make sure resources have been imported by opening the project in the editor at least once."

I created the same script and node in another project and did not encounter this issue. At the same time, I also discovered that in a project where the CSV file is working properly, clicking on the CSV file will result in a red prompt saying "Failed loading resource: res://666689988.csv. Make sure resources have been imported by opening the project in the editor at least onceEditor/editor_ Node. cpp: 1225- Condition "! Res. is_valid()" is true Returning: ERR_ CANT_
But In projects with bugs, double-click on the CSV file No prompts appeared in the editor

Steps to reproduce

  1. Open project file

  2. Open the tscn file named bug.tscn, res://主体/tem

  3. Localized files located at res://888 Add them

Minimal reproduction project (MRP)

地形元.zip

@tanukibouwer
Copy link

I have the same issue in my project. Debugging the engine while running the MRP above, I see that, when loading a CSV Translation file, ResourceFormatImporter::_get_path_and_type returns an error because a path key is missing from the CSV's .import file.

As far as I can tell, this path key is supposed to point towards an imported file in res://.godot/imported/, but there are no such files for the translation CSV files.

@AThousandShips
Copy link
Member

@timothyqiu
Copy link
Member

Your error is caused by adding 666689988.csv to the Translation list in the Project Settings dialog.

The CSV file itself is not a valid translation, you only need to add the derived 666689988.cn.translation and 666689988.en.translation.

@sosasees
Copy link

sosasees commented Sep 20, 2024

i also needed frustrating trial and error to find this out.
either the documentation should have a warning box

don't add the .csv file to translations. add the derived .translation files instead

or better, Godot should not treat adding the .csv file as an error but as a call to add all .translation files with the same name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants