-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Move generated translation files into res://.godot/translations
#42392
Conversation
This comment has been minimized.
This comment has been minimized.
17e19de
to
fd504ba
Compare
fd504ba
to
b3e7a65
Compare
b3e7a65
to
da2e560
Compare
da2e560
to
c999894
Compare
c999894
to
79592a6
Compare
79592a6
to
6a8051d
Compare
6a8051d
to
ba9d1f5
Compare
ba9d1f5
to
8fbc33b
Compare
8fbc33b
to
5b1331c
Compare
5b1331c
to
f7b6fb3
Compare
f7345af
to
005a99b
Compare
005a99b
to
1666709
Compare
res://.godot/translations
1666709
to
4bd264b
Compare
// `.right(6)` strips away the leading "res://". | ||
String stripped_path = TranslationServer::TRANSLATION_FILES_PATH.plus_file(p_source_file.get_basename().right(6)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might not work anymore, right()
was changed in #36180. This should use the clearer substr()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the PR to use substr
. I also tried testing it again, and I wasn't able to get the translation demo to work either with or without this PR. For now I will assume that this specific code still works because it worked when I made the PR.
For the record, the reason I haven't merged this yet is that I'm not sure that translation files can be considered as files which shouldn't be version controlled. I need to double check that. They do get generated from CSVs, but I'm not sure that they get automatically generated or updated, and they depend on enabling specific languages in Project Settings, etc. It's not as clear cut as textures or samples. |
4bd264b
to
679c28d
Compare
679c28d
to
b635532
Compare
b635532
to
6175d10
Compare
6757074
to
970867d
Compare
@akien-mga Is there a way that we can have users select the original CSV and have Godot automatically get the translation file? |
@akien-mga See above :P |
970867d
to
f101d4d
Compare
Follow up to #38607. Implements and closes godotengine/godot-proposals#1812.
This moves the generated
.translation
files into a subfolder ofres://.godot
calledres://.godot/translations
(defined as a constant:TranslationServer::TRANSLATION_FILES_PATH
). These files are generated and don't need to be committed, which is the goal of theres://.godot
folder.Note that projects need to be manually updated, since
project.godot
explicitly references the translation files. For example, the translation demo containsres://text.en.translation
inproject.godot
.The simplest solution was to make the contents of this folder replicate the folder structure of the project, so a file
res://subfolder/text.csv
gets imported asres://.godot/translations/subfolder/text.en.translation
etc. Because the generated translation files have to be referenced explicitly, I think this is actually really nice.Another question is what to call this folder. I think "translation" is nice because it contains.translation
files, but one could make the argument that this folder should be called "translations" instead.