Find the answer to your Linux question:
Results 1 to 2 of 2
Hello everyone, A couple of friends and I are working on a program, and we're in the planning stages right now. We've decided that we'd like the program to be ...
  1. #1
    Linux Engineer Javasnob's Avatar
    Join Date
    Jul 2005
    Location
    Wisconsin
    Posts
    942

    Achieving internationalization

    Hello everyone,

    A couple of friends and I are working on a program, and we're in the planning stages right now. We've decided that we'd like the program to be able to use multiple languages, and allow support for others to be easy to add on. It's written in Lua, and the current idea I have drawn up is like this:

    Code:
    require('i18n')
    
    require(LANGUAGE .. '_section')
    prints(phrase)
      
    en_section.lua:
    phrase = "I like potatoes"
    
    de_section.lua
    phrase = "Ich habe gern Kartoffeln"
    My question is this: Is there an easier way to do this kind of thing? Keeping track of which phrases are mapped to which variables could get painful.

    Thanks for any and all help!
    Flies of a particular kind, i.e. time-flies, are fond of an arrow.

    Registered Linux User #408794

  2. #2
    Linux Engineer Javasnob's Avatar
    Join Date
    Jul 2005
    Location
    Wisconsin
    Posts
    942
    Nevermind; I think I figured out an efficient, non-confusing way to accomplish my goal.
    Flies of a particular kind, i.e. time-flies, are fond of an arrow.

    Registered Linux User #408794

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...