Skip to content
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

Multilingual system (LANG) #34

Closed
qaisjp opened this issue Aug 6, 2013 · 21 comments
Closed

Multilingual system (LANG) #34

qaisjp opened this issue Aug 6, 2013 · 21 comments

Comments

@qaisjp
Copy link

qaisjp commented Aug 6, 2013

I call dibs on implementing this if this is accepted!
A multilingual system to allow multiple languages. A line of flags at the top, clicking a flag switches language instantly. Adding new languages can be strictly GitHub json based through a manually created file OR a generated file via Pootle.

Pootle is a neat web app to collaborate on translating things, i could also try to create a plugin that allows to update .json file through push of a button.
Live: http://translate.mtasa.com
Pootle: http://pootle.translatehouse.org/

@josefnpat
Copy link
Owner

Unless I'm mistaken, here is a list of items that would need to be translated;

  • CLICK TO INSTALL
  • CLICK TO PLAY
  • Applications
  • 20 items
  • Vapor - Loading ..

My only concern is that by doing this, we would be committing to translating the descriptions as well (if we ever plan on having them.)

What's your feeling on this?

@josefnpat
Copy link
Owner

see #38

@qaisjp
Copy link
Author

qaisjp commented Aug 6, 2013

Hmmm, you're right. Perhaps we should close this.

@qaisjp qaisjp closed this as completed Aug 6, 2013
@qaisjp qaisjp reopened this Aug 6, 2013
@josefnpat
Copy link
Owner

I think it's a good idea, but not something we want right away. A good ticket to keep open :)

@josefnpat
Copy link
Owner

The first thing that needs to happen if this ticket is to ever get done is all the English currently in the system needs to be extracted to a language file of some sort. src/lang/en.lua perhaps?

Once we get all of the English abstracted like this, folks who are interested in translating will know what they are up against. This will pave the road to translations.

@ghost
Copy link

ghost commented Dec 2, 2013

Im ready to translate it all to Danish.

@Nixola
Copy link

Nixola commented Dec 2, 2013

I can translate it in Italian

@MadByteDE
Copy link

ready to translate to german. ;)

@Yonaba
Copy link

Yonaba commented Dec 2, 2013

French, for me :)

@josefnpat
Copy link
Owner

What's a good way to implement this?

Perhaps we need a settings screen as a modal (LoveFrames will provide this very well) that has a drop-down box for languages?

@Ranguna
Copy link

Ranguna commented Dec 4, 2013

Portuguese from Portugal here
Most aplications use an .xml file with all the text, then the aplications loads all the text into individual variable from the localization file and instead of printing "hello" it prints the variable that has the "hello" word.

@josefnpat
Copy link
Owner

@Ranguna

Since the data is only going to be used for the client, I was thinking either;

  • Lua (since this is vapor's native language)
  • JSON (Since we already have the JSON4Lua library included in vapor already.)

I was working on something already, and it looks like this:

English

local l = {}

l.id = "EN"
l.name = "English"

l.settings = "Settings"
l.loading = "Loading"

return l

Cat

local l = {}

l.id = "MEOW"
l.name = "Cat"

l.settings = "Litterbox"
l.loading = "Stretching"

return l

@MadByteDE
Copy link

sure, but can also realized using a .lua file, too.
Example: lua file

@josefnpat
Copy link
Owner

@MadByteDE My thoughs exactly. Let me post it here for posterity:

-- // Localization DE / German \\ --

local text = {

  -- in german later of course
  infoBox_description = "Vapor is an awesome löve game distribution client ...bla bla bla",
  gameSelection_header = "Game Selection",
  item_all = "All",
  item_favorites = "Favorites",
  item_downloaded = "Downloaded",
  item_new = "New",

  }


return text -- accesspoint for all text variables

@riidom
Copy link

riidom commented Dec 5, 2013

Maybe useful to have each line doubled, one commented out and in english, the duplicate below meant to contain the translation. Easier to work, if the source string is right there.
Also, are you handling variable string length well in most places? English is sometimes a problematic source, since it is short.

@Nixola
Copy link

Nixola commented Dec 5, 2013

We should also have a proper way to handle names, their position in the sentence can vary in different languages

@MadByteDE
Copy link

@riidom, this might be helpful, good idea.
@Nixola, which sentences ? The game description? Do you want to translate all the descriptions?
This might get pretty ugly and is a lot of work. I would try to modify the games.jason file and add extra variables for descriptions. Then, inside the client of someone who has set another language as english, the description should be readable in english and then there could be an option for everyone which says "Description is unavailable in your language, feel free to [link]translate it[/link]." -> User submit -> someone check and validate it - > add it to the games.jason as "description_language". Something like that maybe.

@josefnpat
Copy link
Owner

@riidom I was thinking of writing a script that used one language as the "master" (most likely english) and then checked the other language files to make sure they have all the variables, otherwise disable/default them.

String length shouldn't be too much of a problem I hope, but translators need to be aware of it.

@Nixola At the moment most variables within strings are just things like Size: %d which uses a format to fill in the %d. This should allow dynamic placement in the future regardless.

@MadByteDE Do you think we should translate descriptions?

As I see it now, there are 26 strings to translate (see bottom of this post).

For vapor, it would be feasable to have and keep up to date with ~6 languages (assuming it's one person per language.)

But when we change that to include the game description, it jumps 50+ entries.

Also, it will slow down the rate at which games are released, as we would need to have descriptions translated.

In my opinion, only the UI should be translated, skip the description. I mean, at the moment all the games are in English anyway.

return {

  -- Internal

  id = "EN",
  name = "English",

  -- Tabs

  list_all = "All",
  list_all_tooltip = "All games (%d)",
  list_favorite = "Favorites",
  list_favorite_tooltip = "Your favorite games",
  list_downloaded = "Downloaded",
  list_downloaded_tooltip = "Downloaded games",
  list_new = "New",
  list_new_tooltip = "Recently added games (%d)",

  -- Global Buttons

  settings = "Settings",
  settings_tooltip = "Configure Vapor",

  -- Info Section

  size = "Size",
  welcome = "Welcome to Vapor.",
  nodescription = "No description availible.",

  -- Info Button Status

  download = "Download",
  download_tooltip = "Download this game now.",
  downloading = "Downloading ...",
  downloading_tooltip = "Your game is downloading.",
  hashing = "Hashing ...",
  hashing_tooltip = "Your game is hashing.",
  invalid = "Error",
  invalid_tooltip = "There has been an error. Click to delete this game.",
  play = "Play",
  play_tooltip = "This game is ready to play.",

  -- Game Buttons

  favorite_tooltip = "Mark this game as a favorite.",
  delete_tooltip = "Delete this game.",
  website_tooltip = "Visit the author's website."

}

@Yonaba
Copy link

Yonaba commented Dec 5, 2013

Translate game descriptions ? No, we should not do that.
Only the UI will be enough.
I also think that there is no need to have a ton of translations. Maybe 3~5 languages maximum.
Just my two cents. 👍

@qaisjp
Copy link
Author

qaisjp commented Dec 7, 2013

sorted into lang files, in lang/isocode.lua (en.lua, pl.lua, es.lua, etc)
example code content is:
https://gist.github.com/anonymous/c190cbd5ca634a317a31
scopes are separated by "_", so usage incode would be _"list_all"or
_("list", "all")for the obvious. since lang.list.all is a table, it uses
the first index. butlist_all_tooltipwould work to get the specific item.
the function to access it would preferably be_ for cleanliness.

just a suggestion.

On 5 December 2013 22:38, Roland Y. notifications@github.com wrote:

Translate game descriptions ? No, we should not do that.
Only the UI will be enough.
I also think that there is no need to have a ton of translations. Maybe
3~5 languages maximum.
Just my two cents. [image: 👍]


Reply to this email directly or view it on GitHubhttps://github.com//issues/34#issuecomment-29946037
.

@josefnpat
Copy link
Owner

I have added with this commit (6bf3b4e) the language system.

@RadioActiveGears @Nixola @MadByteDE @Yonaba @Ranguna

If you are still interested in creating a new language for vapor:

  • Be dedicated about it. If you abandon your language, and I cannot get a translation easily, I will have to remove it.
  • Create a new issue entitled: "ADD LANG " so that I can ping you when I need to get translations.
  • Use src/core/lang/en.lua as a guide, as that will always be up to date, since EN is the default language.

josefnpat added a commit that referenced this issue Jan 10, 2014
Relates to #34 and commit 6bf3b4e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants