Results 1 to 4 of 4

Thread: Set language pack

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2008
    Posts
    2

    Set language pack

    Hello,

    I'm trying to implement an langauge system in my java app.
    I have in the language pack 3 .java files:
    - English
    - Spanish
    - Language

    The language.java file makes the variables public static and the english or spanish.java file defines the variables. Only I can't get this working.

    Code:
    package com.blades.decoy.settings.language;
    
    public interface Language {
        String msg_welcome = "";
        String msg_connect_info = "";
        String msg_ip_info = "";
        String msg_port_info = "";
        String btn_connect = "";
        
        public static String msg_login_info = "";
        public static String msg_login_fault_password = "";
        public static String msg_login_fault_username = "";
        public static String msg_login_correct = "";
        public static String btn_login = "";
    }
    In the english.java and spanish.java netbeans says: "Local variable hides a field." How would you make the english.java file?

    Many thanks,

    Night Fox

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: Set language pack

    I don't know what you are trying to say but this is not the way we do localization in java..
    http://bits.netbeans.org/dev/javadoc...-branding.html
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2008
    Posts
    2

    Re: Set language pack

    Quote Originally Posted by ComputerJy
    I don't know what you are trying to say but this is not the way we do localization in java..
    http://bits.netbeans.org/dev/javadoc...-branding.html
    That's not what I was looking for. I just want to define the variables in another .java file. Is that simple enough =).

    Thx.

  4. #4
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: Set language pack

    Well, the warning "Local variable hides a field" means that a variable in some method has the same name as a class member.. It's just a warning not an error, meaning that in that method you need to use this.fieldName to access the class member instead of just using fieldName.
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

Posting Permissions

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



Click Here to Expand Forum to Full Width