Comments (32)
Found some problems with unicode:
- Unicode symbols don't show up in a grid menu description.
- Unicode symbols make offsets to work incorrectly.
Text is not in the center of the screen.
There are no spoilers on GitHub :(
from kag-base.
I could also help, if needed.
from kag-base.
Need any help for translation? I'd like to do the simplified Chinese part.
from kag-base.
There isn't a lot of things translated and support is still very early - everything that is hardcoded in the engine (i.e. using irrlicht GUI) doesn't have translations just yet, because I didn't have engine access at the time. The only engine-side change I did for translations is implementing the dropdown menu for selecting languages.
You should see some strings translated with the french locale, for example in the scoreboard menu, some gamemode related strings or help-related strings. Tips should be translated too, but for some reason they seem broken...
from kag-base.
Thanks. I see. Hard coding may need more works. Thanks for your devotion.
from kag-base.
Spoilers aren't needed for the most part, but if you'd like to keep comments small you can always create a gist and link it.
Thanks for the reports, I'll see what I can do.
from kag-base.
@Ni-ice - feel free to jump in and help! The RU file is the most comprehensive base json file at current I think. All you need to do is copy that file to {FullLanguageName}_{StandardLanguageInitials}.json
(eg Spanish_es.json
), remove all the Russian translations and replace them with the translations of your respective language.
It would be prudent to post in the respective language-specific forum and the discord to get help, and then work in a translation-specific fork in your repository. You can collaborate with other users using pull requests between your forked repos (or they can just send you the files, but you're more likely to clobber each other's changes that way) - and when you think the changes are good enough to include in vanilla, you can make a PR here as @diprog has been doing 👌
If you need further help it'd be best to either write here or ask Diprog and Asu about it in #development on Discord 👍
from kag-base.
Awesome! If you run into any issues let us know in #development on Discord.
from kag-base.
The XML stuff is deprecated and from classic.
The json-based cl_locale
translations are "the way forward" though they aren't very fleshed out at the moment because there has been minimal community interest. There isn't an in-game way to toggle it on as a result but I'd be happy to add some form of locale selection once things are more mature (it can be turned on for the GUI at that stage)
Partial translations are fine. As you can see the PL one is just a proof of concept!
Names only need to be translated for display - they don't need to be stored that way. If the lookups prove to be a performance issue they can be cached reasonably easily on a per-script basis.
Namespacing things isn't super likely - it's do-able but just adds more indirection and I'm not sure it really helps with the verb/noun side of things.
As you mention at the bottom could be able to be differentiated by variable substitution. I'd rather keep the strings {KILLER} named rather than using {0} and co for easier 3rd party translation and just use basic replace script-side. Getting that variable substitution in is pretty important because many languages don't have a compatible way of saying things to English.
from kag-base.
I've done a translation helper class to provide the variable substitution as well, and it performs reasonably fast: Approx ~3x slower (without the parsing stage) than a barebones solution in multiple of my tests (long lorem ipsum and short text). Since not everything needs to use this it looks fine to me.
The parser shouldn't be very slow. It doesn't care about the untranslated, unformatted version of the string and is pretty basic.
It is pretty straightforward and it allows variables to be automatically translated, e.g.
{KILLER} has killed {VICTIM} with {@ITEM}
- ITEM
will be automatically translated because of the @
character. Of course, reordering variables works too.
The FormattedTranslation
should ideally be built once, and the usage looks like this:
string[] order = {"KILLER", "VICTIM", "ITEM"};
FormattedTranslation tr("{KILLER} has killed {VICTIM} with {@ITEM}", order);
string[] replace = {"copper40", "kf9000", "a hammer"};
print(tr.translate(replace));
Unfortunately it doesn't seem possible in the AS version KAG uses to anonymously initialize arrays with an initialization list (according to the wiki, the syntax would be string[] = {"KILLER", "VICTIM", "ITEM"}
). That's not really convenient sadly... I assume it would be quite not trivial to update AS?
from kag-base.
I'm not sure that this translation helper is of huge value - it's an interesting idea but seems like it doesn't cut down much on the code from the simple replace() based version which can pre-translate variables to be inserted as appropriate. If it's not faster and not smaller I don't see much benefit and think that it'd be better to pursue getting the translations used in more places, standardising the syntax for translations and getting a handle on how much text really needs translation.
Updating AS is indeed not a trivial matter, though should be easier than with irrlicht if absolutely necessary because there's at least not thd-side untracked modifications to it as far as i'm aware.
from kag-base.
You're pretty right actually, the replace()
method is only about a quarter slower in a scenario that doesn't help it much, and it is actually pretty short to use, so I'll drop my Translations.as
file in my branch.
from kag-base.
client_AddToChat
doesn't seem to support unicode characters apparently? It's not great for french but this makes it impossible to translate to some languages (it isn't often used, but it is e.g. for resupplies in TTH).
Logging also doesn't support unicode correctly according to deynarde.
But overall, it looks like GUI functions prints unicode pretty well. It's pretty straightforward for those.
from kag-base.
Sorry, I missed the more recent comment here.
The "full" unicode support of the engine is unlikely to ever be there; there's stuff like RTL scripts that as far as I can tell will never work with our font engine, decorator stuff and so forth. The unicode implementation inside irrlicht is heavily UTF-16 based (to mimic windows) but as far as I can tell is somewhat buggy. We try to keep things inside AS scripts as UTF-8 and convert to widestrings as late as possible. I'll put both client_AddToChat and the logging functions on the list but I'd be unsurprised if the logging never really supports unicode in the console at least as it's my understanding that the command prompt "wants" system-locale-dependent multi-byte encoding but in the log file we "want" utf8.
from kag-base.
@suzumiyasmith hello! Any help with translation is welcome but chinese simplified will need some testing of parts of the engine probably and I'm not sure if our font supports it.
- will need what @asumagic is working on to be finalised
- will need some engine-side changes to allow the out-of-game GUI to be translated properly
- will need the first set of strings decided on for a dedicated translation work
- will need to ensure the font engine can correctly render chinese glyphs and a suitable open-license font to distribute with the game for chinese users.
If you're willing to be part of this on an on-going basis then getting in touch with Asu directly could be best. Other helpful things would be starting on the testing side of things and ensuring that the substitution system proposed will work for chinese translations.
from kag-base.
I have noticed today's update, and am really glad to hear about that.
Update log said the translation is available now. However, when I try setting language local to Francais, it seems nothing happened even if I restart the client.
Any idea?
from kag-base.
The menus will be our next priority for translation stuff I'd say, as it's the other big "important" thing beyond being able to read things in-game.
Tutorials and the like might take a little longer to translate as there's a lot of text there that isn't seen very often, and they might change in the future as they're very rough currently anyway.
from kag-base.
Also generic buttons can't draw unicode too
from kag-base.
Any way to translate such global messages?
rules.SetGlobalMessage("\nMatch starts in " + ((ticksToStart / 30) + 1));
from kag-base.
Something like this probably:
s32 seconds = ((ticksToStart / 30) + 1);
rules.SetGlobalMessage(
"\nMatch starts in {SEC}"
.replace("{SEC}","" + seconds)
);
from kag-base.
Ehm. Server will replace the string and then send it to clients, so clients will translate "\nMatch starts in 30" for example.
Yeah, it does not work.
from kag-base.
@diprog oh, I see - sorry, I was a bit out of sorts towards the end of last week. Yes this is a big problem with using the global message for anything dynamic I guess.
I think the easiest recourse there would be to convert it to use script-side rendered text and avoid the global message in any dynamic cases - that way we can use the replacement but do it clientside after correct translation.
from kag-base.
@1bardesign
My stupid way of translating global messages
from kag-base.
Just to clarify, which language effort would you be able to help with, @Ni-ice ?
from kag-base.
German or Spanish.
from kag-base.
@diprog I'm not sure how closely you are watching this but the server browser translation stuff is now partially included in the test build, along with terrible google translate strings.
I think I lost some of your existing translations for the browser strings in the process, sorry! 😅 If you have some time this week to check them they are at the bottom of the ru json and could use some attention.
from kag-base.
@1bardesign finally, thanks.
from kag-base.
@asumagic @diprog @Suprejso can we get the existing translations on-par with each other in the next release cycle? RU is furthest ahead but I think there are some remaining "google translate" strings in there!
@Ni-ice are you interested in doing any of those German or Spanish translations or is it too much of a time commitment at the moment? The files are there!
from kag-base.
@1bardesign Sorry, I'm totally doing that. I'll start today when I'm finally back home!
from kag-base.
I have started for Turkish translation.
from kag-base.
Hello, looking to update my Greek translation I did some years back as I've noticed its become outdated and some things can be improved. Is there a standard we follow ? Is there a locale file you wish to use as base ? Or do I just copy a random one (say the italian one) and start from there ?
from kag-base.
Right now it's a bit of a mess and I don't know which translation file has the most up-to-date entries. I think the German one should be fairly up-to-date as mugg91 recently improved it.
from kag-base.
Related Issues (20)
- Add a trampoline emote
- Small CTF map FG_Bigpit has bad tree placement
- Fireplace some collision checks missing
- BasicHelps.as issues
- Inventory icon doesn't update when changing team HOT 1
- Coins are bugged (online)
- KickAFK will not work with bots HOT 1
- KickAFK should not take effect when dead HOT 1
- You can get stuck by an enemy builder's placed door
- Border of map is not aligned correctly
- Boulder can be arrow shot insanely far
- Many fireplaces will make many foods from one ingredient HOT 2
- SetEmitSoundPlayPosition() doesn't work HOT 1
- Bots will not be evenly assigned teams HOT 1
- Make lamp in sandbox shine in team color HOT 1
- "/spawn spikes" near a wall causes spikes to be bugged
- back jab
- Arrow collision problem
- Obstructor minimap issue HOT 1
- Don't subtract coins after match ends in TDM
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kag-base.