Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multi Languages
#1
*Introduction:

NOTE! This VDF won't magically support more languages, it only adds more fonts for other languages, it's more like a useful compontent for building this kind of support
Info: The VDF itself is a collection of .fnt and .tex files made by Piranha Bytes, it can be useful for you if you want to make a multi-lang server.

Hi, i've made a long time ago a simple VDF which contains SOME multiple languages fonts.
Currently in VDF threre are 4 supported languages:
  • English - EN
  • Polish - PL
  • Russian - RU
  • German - DE

Download

All of the fonts comes from the G2 NotR (Gothic2 + Addon).
In order to differentiate those fonts i placed language prefix.
The scheme of the filename looks like this: PREFIX_[fontName].TGA
For example: EN_FONT_OLD_10_WHITE_HI.TGA

You can find default font list is avalible on wiki.
All of those fonts are in VDF file, you simply have to put a LANG prefix before filename, just like in above example.

All of those languages are by default supported by the G2O.
Below i put list of G2O functions which uses/adds this language support.

getKeyLayout
setKeyLayout
getKeyLetter

This doesn't mean that other languages can't be supported.
You can always modify this VDF to your own needs, and overload the getKeyLayout, setKeyLayout, getKeyLetter functions in squirrel.
Those functions are responsible for "showing" the right character when you type in g2o.

G2O also offer chatInput functions , and they also should be fully overloaded
But, i'm not going to cover this in this post.



*Overloading squirrel functions example:

Squirrel Script
  1. local currentLayout = 0
  2.  
  3. getKeyLayout = function()
  4. {
  5. return currentLayout
  6. }
  7.  
  8. local _setKeyLayout = setKeyLayout
  9. setKeyLayout = function(layout)
  10. {
  11. if (layout < 0 || layout > 4)
  12. return
  13.  
  14. currentLayout = layout
  15. _setKeyLayout(layout)
  16. }
  17.  
  18. local _getKeyLetter = getKeyLetter
  19. getKeyLetter = function(key)
  20. {
  21. if (currentLayout < 4)
  22. return _getKeyLetter(key)
  23.  
  24. // your implementation of key mappings for other langs
  25. // this example adds another language in id 4, but you can always modify it and add more than one additional lang.
  26. // Anyway, this is everything that you must do for G2O, to support more keyboard layouts.
  27. }



*Installation:



1.Download VDF
2.Go to: DRIVE:/YourGamePath/Data
3.Put the downloaded file in the above directory
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)