Closed h0lley closed 2 years ago
This could probably be supported, though there is no good way to distinguish the multiple entries with this setup. Numbering them might cause headaches to translators when new entries get added/removed.
I've got this to work with both arrays and multiline strings. keep in mind the code is probably improvable as I have hardly any experience with python, and it could definitely use some more testing.
here's some scenarios it attempts to cover:
keyword = "hello"
keyword = "hello
second line
third line"
keyword = ["first item", "second item"]
keyword = ["first
item", "second item"]
keyword = ["first
item", "second item", "third
item"]
keyword = ["first
item", "second item", "third item", "forth
item"]
keyword = ["first
item", "second
item", "third
item", "forth
item"]
Is this already in the newest release?
This has not been implemented no.
Oh I thought the pull request was merged. Did not noticed that it was just closed. Did his implementation not work?
Oh I thought the pull request was merged. Did not noticed that it was just closed. Did his implementation not work?
works just fine in my fork.
Multiline strings were added #10, but not arrays. I don't remember why. I will try to look into it.
Is there any progress on this? A feature like this is pretty much vital for a project I'm working on (I think, at least) and without it I'll have to write a separate script myself because I lack the knowledge to extend the plugin :P
@GTcreyon the version I use probably differs too much at this point for another pull request, but it supports arrays of (multiline) strings, so there's no need for you to write your own.
@h0lley Ah, lovely! Would you be able to explain briefly how to access it? I installed the original plugin through pip, and I have a limited knowledge of how that works, so a full explanation would be very helpful.
@GTcreyon you can list the forks of this repository here: https://github.com/remram44/pybabel-godot/network/members click mine and read the readme.
on my system the babel_godot.py
is located in /home/username/.local/lib/python3.9/site-packages
.
if you are on Windows just google where python packages are stored.
You can simply install it with pip: pip install git+https://github.com/h0lley/pybabel-godot.git#egg=babel-godot
Fantastic, thank you both! Have a great day!
Ah, it seems to break when the string contains square brackets.
@GTcreyon have you tried the implementation remram44 just merged?
otherwise, if you are using my fork, it would make more sense for you to create an issue about it in the corresponding repo.
but definitely try the original author's fix first.
Apologies, yes, that solved it. I'll post the issue in the relevant repo. Thank you!
This time I have something I'd really love to see. ;) I have GDScripts that export variables like this:
This enables me to create any number of dialogue text boxes neatly from the inspector. The result is then saved in the scene file like this:
multiline example:
but it is not picked up by pybabel with
-k dialogue_text
. It would be best if pybabel could add the strings from the array as individual entries to the POT.though I fear this is similarly out of scope for this project than the issue with the escaped script?