-
Notifications
You must be signed in to change notification settings - Fork 48
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
Translations #50
Comments
I haven't tried / used the scraper, but of course automatic updates would be a big improvement over our current approach.
The option you mentioned probably would be the easiest to realise, but then again it would bloat the whole api table even more. It would be nice if we could move translations to seperate files / tables and just fetch the correct entry based on IDs / keys ... not sure how to approach this though. I like the idea of translating missing pages via google translate though. All in all I think this would be an useful addition, though it always depends on the quality (and quantity) of the translations on the actual wiki. Right now for example the german wiki is missing a lot of pages and a lot of the translated ones are pretty outdated :/ |
I actually don't mind the table being bloated that much, because it's not much different either way for the user of the table. What I am thinking of though is what would make it easiest for translators if, hypothetically some time in the future, this was the primary place of documentation/translation rather than the wiki? Could this possibly provide a better translating experience? Another reason for keeping translations in separate files might be that each file could be maintained by different people, since it would be kind of weird accepting pull requests from a language the maintainer wasn't familiar with. One idea would be to have a table with function name keys, which contains tables with pairs of English and translated strings that this function has. This file could be checked against the main table to find any missing translations. One thing I'm not sure about though is how it could be made easy to change the main English table and then have these changes automatically or easily applied to the translated tables. {
['love.graphics.draw'] = {
'Draws a Drawable object (an Image, Canvas, SpriteBatch, ParticleSystem, Mesh, or Video) on the screen with optional rotation, scaling and shearing. Etc...',
'Zeichnet ein zeichenbares Objekt (z.B. ein Bild) auf den Bildschirm, wobei sich Größe, Rotation und Scherung anpassen lassen. Etc...',
'drawable',
'drawable',
'A drawable object.',
'Ein zeichenbares Objekt.',
'x',
'x',
'The position to draw the object (x-axis).',
'Die Position auf der x-Achse an der das Objekt gezeichnet werden soll.',
'y',
'y',
'The position to draw the object (y-axis).',
'Die Position auf der y-Achse an der das Objekt gezeichnet werden soll.',
'r',
'r',
'Orientation (radians).',
'Die Rotation in Radianten.',
'sx',
'sx',
'Scale factor (x-axis).',
'Der Skalierungsfaktor in x-Richtung.',
'sy',
'sy',
'Scale factor (y-axis).',
'Der Skalierungsfaktor in y-Richtung.',
'ox',
'ox',
'Origin offset (x-axis).',
'Verschiebung vom Urpsrung auf der x-Achse.',
'oy',
'oy',
'Origin offset (y-axis).',
'Verschiebung vom Urpsrung auf der y-Achse.',
'kx',
'kx',
'Shearing factor (x-axis).',
'Der Scherfaktor in x-Richtung.',
'ky',
'ky',
'Shearing factor (y-axis).',
'Der Scherfaktor in y-Richtung.',
'quad',
'quad',
'The Quad to draw on screen.',
'Das Quad welches gezeichnet werden soll.',
}
} |
This isn't perfect to say the very least, but, here is a start of some translations! https://github.com/love2d-community/love-api/blob/gh-pages/test/api.lua I've also added the mini-translations as seen on the module/type pages on the wiki, because I figure this would be especially useful for languages other than English; instead of just reading function names in the navigation, there's a little translated description too. The code which generates the translations is a mess. Basically what happens is:
I managed to mess this up pretty badly, especially the automatic translations, but hey, it's a start. :P |
I've moved this for the time being to: https://github.com/santoslove/love-api-experiments/ |
I think it might be nice if love-api had translated descriptions.
Things I'm unsure of:
How can the translated text can be automatically retrieved from the wiki? Would the scraper from SublimeLove be a useful starting point?
What's the best way of putting the translations into the love-api table?
One option is to have a translations table next to every description:
de =
Ob Texteingabeereignisse aktiviert sind. [auto]'`@rm-code, since you're a wiki translator I'm sure you have a much better idea about all of this stuff than me! :)
Also I just noticed now how much better the documentation could be for languages other than English... The module pages (e.g. http://www.love2d.org/wiki/love.keyboard_(Deutsch) ) only list translated functions (surely it would be better if the English version was there if the translated version was unavailable?), and the module links on the left side bar only link to English pages.
So, this all seems like a lot of work and I don't think it will/should happen necessarily, but I just wanted to post this as a "pie in the sky" feature. :)
The text was updated successfully, but these errors were encountered: