It worked when launching the game in the editor, but it doesn't work when launching a build-version.
The directory has been added to the Filters to export non-resource files or folders and the file names can be seen by opening the .pck file via Notepad.
Files:
- res://Locales/en-us/Server.json
- res://Locales/en-us/Player.json
- res://Locales/en-us/User.json
- res://Locales/en-us/Command.json
Filters to export non-resource files or folders:
Locales/*, *.json
Code:
string path = "res://Locales/en-us/";
Directory dir = new Directory();
dir.Open(path);
dir.ListDirBegin(true, true);
string file = "";
do {
file = dir.GetNext();
if (file.EndsWith(".json")) {
GD.Print(path + file);
}
} while (file != "");
dir.ListDirEnd();
It outputs names of all the files in the target directory in the editor, and nothing in the built game.