Annotation of modules/damieng/graphical_editor/daxe/lib/src/locale.dart, revision 1.1
1.1 ! damieng 1: /*
! 2: This file is part of Daxe.
! 3:
! 4: Daxe is free software: you can redistribute it and/or modify
! 5: it under the terms of the GNU General Public License as published by
! 6: the Free Software Foundation, either version 3 of the License, or
! 7: (at your option) any later version.
! 8:
! 9: Daxe is distributed in the hope that it will be useful,
! 10: but WITHOUT ANY WARRANTY; without even the implied warranty of
! 11: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! 12: GNU General Public License for more details.
! 13:
! 14: You should have received a copy of the GNU General Public License
! 15: along with Daxe. If not, see <http://www.gnu.org/licenses/>.
! 16: */
! 17:
! 18: part of daxe;
! 19:
! 20: class Locale {
! 21:
! 22: String language;
! 23: String country;
! 24:
! 25: Locale() {
! 26: List<String> l = Strings.systemLocale.split('_');
! 27: language = l[0];
! 28: if (l.length > 1)
! 29: country = l[1];
! 30: else
! 31: country = null;
! 32: }
! 33:
! 34: Locale.l(String language) {
! 35: this.language = language;
! 36: this.country = null;
! 37: }
! 38:
! 39: Locale.lc(String language, String country) {
! 40: this.language = language;
! 41: this.country = country;
! 42: }
! 43:
! 44: int get hashCode {
! 45: int result = 17;
! 46: result = 37 * result + language.hashCode;
! 47: result = 37 * result + country.hashCode;
! 48: return result;
! 49: }
! 50:
! 51: bool operator ==(Locale other) {
! 52: return(language == other.language && country == other.country);
! 53: }
! 54:
! 55: }
! 56:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>