By GokiSoft.com| 10:25 21/09/2021|
Java Advanced

[Share Code] Tìm hiểu đa ngôn ngữ - lập trình Java - C2009G BT2414

#globals_en_US.properties


# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.

option_input = 1. Input student
option_display = 2. Display student
option_exit = 3. Exit
option = Choose: 


#globals.properties


# To change this license header, choose License Headers in Project Properties.
# To change this template file, choose Tools | Templates
# and open the template in the editor.

option_input = 1. Nhap thong tin sinh vien
option_display = 2. Hien thi danh sach sinh vien
option_exit = 3. Thoat
option = Chon: 


#Main.java


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package lesson09;

import java.util.Locale;
import java.util.ResourceBundle;

/**
 *
 * @author Diep.Tran
 */
public class Main {
    public static void main(String[] args) {
        showMenu();
    }
    
    static void showMenu() {
        Locale locale = new Locale("en", "US");
        ResourceBundle bundle = ResourceBundle.getBundle("lesson09.globals", locale);
        
        System.out.println(bundle.getString("option_input"));
        System.out.println(bundle.getString("option_display"));
        System.out.println(bundle.getString("option_exit"));
        System.out.println(bundle.getString("option"));
    }
}


Tags:

Liên kết rút gọn:

https://gokisoft.com/2414

Bình luận