Giter Site home page Giter Site logo

Translations about kag-base HOT 32 OPEN

transhumandesign avatar transhumandesign commented on August 13, 2024
Translations

from kag-base.

Comments (32)

diprog avatar diprog commented on August 13, 2024 3

Found some problems with unicode:

  1. Unicode symbols don't show up in a grid menu description.
    screen-17-10-17-16-33-34
  2. Unicode symbols make offsets to work incorrectly.
    screen-17-10-18-17-36-16
    Text is not in the center of the screen.
    screen-17-10-16-20-20-40

There are no spoilers on GitHub :(

from kag-base.

NiNuNa avatar NiNuNa commented on August 13, 2024 3

I could also help, if needed.

from kag-base.

suzumiyasmith avatar suzumiyasmith commented on August 13, 2024 2

Need any help for translation? I'd like to do the simplified Chinese part.

from kag-base.

asumagic avatar asumagic commented on August 13, 2024 1

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.

suzumiyasmith avatar suzumiyasmith commented on August 13, 2024 1

Thanks. I see. Hard coding may need more works. Thanks for your devotion.

from kag-base.

1bardesign avatar 1bardesign commented on August 13, 2024 1

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.

1bardesign avatar 1bardesign commented on August 13, 2024 1

@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.

Mazey avatar Mazey commented on August 13, 2024 1

Awesome! If you run into any issues let us know in #development on Discord.

from kag-base.

1bardesign avatar 1bardesign commented on August 13, 2024

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.

asumagic avatar asumagic commented on August 13, 2024

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.

1bardesign avatar 1bardesign commented on August 13, 2024

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.

asumagic avatar asumagic commented on August 13, 2024

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.

asumagic avatar asumagic commented on August 13, 2024

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.

1bardesign avatar 1bardesign commented on August 13, 2024

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.

1bardesign avatar 1bardesign commented on August 13, 2024

@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.

suzumiyasmith avatar suzumiyasmith commented on August 13, 2024

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.

1bardesign avatar 1bardesign commented on August 13, 2024

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.

diprog avatar diprog commented on August 13, 2024

Also generic buttons can't draw unicode too

from kag-base.

diprog avatar diprog commented on August 13, 2024

Any way to translate such global messages?
rules.SetGlobalMessage("\nMatch starts in " + ((ticksToStart / 30) + 1));

from kag-base.

1bardesign avatar 1bardesign commented on August 13, 2024

Something like this probably:

s32 seconds = ((ticksToStart / 30) + 1);
rules.SetGlobalMessage(
	"\nMatch starts in {SEC}"
	.replace("{SEC}","" + seconds)
);

from kag-base.

diprog avatar diprog commented on August 13, 2024

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.

1bardesign avatar 1bardesign commented on August 13, 2024

@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.

diprog avatar diprog commented on August 13, 2024

@1bardesign image
My stupid way of translating global messages
image

from kag-base.

1bardesign avatar 1bardesign commented on August 13, 2024

Just to clarify, which language effort would you be able to help with, @Ni-ice ?

from kag-base.

NiNuNa avatar NiNuNa commented on August 13, 2024

German or Spanish.

from kag-base.

1bardesign avatar 1bardesign commented on August 13, 2024

@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.

diprog avatar diprog commented on August 13, 2024

@1bardesign finally, thanks.

from kag-base.

1bardesign avatar 1bardesign commented on August 13, 2024

@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.

NiNuNa avatar NiNuNa commented on August 13, 2024

@1bardesign Sorry, I'm totally doing that. I'll start today when I'm finally back home!

from kag-base.

mustafatufan avatar mustafatufan commented on August 13, 2024

I have started for Turkish translation.

from kag-base.

its-kos avatar its-kos commented on August 13, 2024

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.

asumagic avatar asumagic commented on August 13, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.