1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2024-10-27 20:34:16 +00:00

Lang: Fix misspelling of hijri [#837]

This commit is contained in:
gnosygnu 2021-02-07 10:41:56 -05:00
parent 559503786b
commit 7e53c8462d
4 changed files with 468 additions and 443 deletions

View File

@ -1,6 +1,6 @@
/* /*
XOWA: the XOWA Offline Wiki Application XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012-2017 gnosygnu@gmail.com Copyright (C) 2012-2021 gnosygnu@gmail.com
XOWA is licensed under the terms of the General Public License (GPL) Version 3, XOWA is licensed under the terms of the General Public License (GPL) Version 3,
or alternatively under the terms of the Apache License Version 2.0. or alternatively under the terms of the Apache License Version 2.0.
@ -13,10 +13,20 @@ The terms of each license can be found in the source code repository:
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
*/ */
package gplx.xowa.xtns.pfuncs.times; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.pfuncs.*; package gplx.xowa.xtns.pfuncs.times;
import gplx.core.btries.*;
import gplx.xowa.langs.*; import gplx.xowa.langs.msgs.*; import gplx.Bool_;
import gplx.xowa.parsers.*; import gplx.Byte_;
import gplx.Byte_ascii;
import gplx.DateAdp_;
import gplx.Int_;
import gplx.List_adp;
import gplx.String_;
import gplx.core.btries.Btrie_fast_mgr;
import gplx.core.btries.Btrie_rv;
import gplx.xowa.langs.msgs.Xol_msg_itm_;
import gplx.xowa.parsers.Xop_ctx;
public class Pft_fmt_itm_ { public class Pft_fmt_itm_ {
public static final int public static final int
Tid_seg_int = 1 Tid_seg_int = 1
@ -48,10 +58,10 @@ public class Pft_fmt_itm_ {
, Tid_iranian_month_idx = 27 , Tid_iranian_month_idx = 27
, Tid_iranian_day_idx = 28 , Tid_iranian_day_idx = 28
, Tid_iranian_month_name = 29 , Tid_iranian_month_name = 29
, Tid_hijiri_year_idx = 30 , Tid_hijri_year_idx = 30
, Tid_hijiri_month_idx = 31 , Tid_hijri_month_idx = 31
, Tid_hijiri_day_idx = 32 , Tid_hijri_day_idx = 32
, Tid_hijiri_month_name = 33 , Tid_hijri_month_name = 33
, Tid_timezone_id_full = 35 , Tid_timezone_id_full = 35
, Tid_timezone_id_abrv = 36 , Tid_timezone_id_abrv = 36
, Tid_timezone_offset_4 = 37 , Tid_timezone_offset_4 = 37
@ -107,10 +117,10 @@ public class Pft_fmt_itm_ {
, Iranian_month_idx = new Pft_fmt_itm_iranian_month_idx() , Iranian_month_idx = new Pft_fmt_itm_iranian_month_idx()
, Iranian_day_idx = new Pft_fmt_itm_iranian_day_idx() , Iranian_day_idx = new Pft_fmt_itm_iranian_day_idx()
, Iranian_month_name = new Pft_fmt_itm_iranian_month_name() , Iranian_month_name = new Pft_fmt_itm_iranian_month_name()
, Hijiri_year_idx = new Pft_fmt_itm_hijiri_year_idx() , hijri_year_idx = new Pft_fmt_itm_hijri_year_idx()
, Hijiri_month_idx = new Pft_fmt_itm_hijiri_month_idx() , hijri_month_idx = new Pft_fmt_itm_hijri_month_idx()
, Hijiri_day_idx = new Pft_fmt_itm_hijiri_day_idx() , hijri_day_idx = new Pft_fmt_itm_hijri_day_idx()
, Hijiri_month_name = new Pft_fmt_itm_hijiri_month_name() , hijri_month_name = new Pft_fmt_itm_hijri_month_name()
, Timezone_id_full = new Pft_fmt_itm_timezone_id(Bool_.N) , Timezone_id_full = new Pft_fmt_itm_timezone_id(Bool_.N)
, Timezone_id_abrv = new Pft_fmt_itm_timezone_id(Bool_.Y) , Timezone_id_abrv = new Pft_fmt_itm_timezone_id(Bool_.Y)
, Timezone_offset_4 = new Pft_fmt_itm_timezone_offset_4(Bool_.N) , Timezone_offset_4 = new Pft_fmt_itm_timezone_offset_4(Bool_.N)
@ -125,7 +135,7 @@ public class Pft_fmt_itm_ {
.Add(Byte_ascii.Ltr_m , Pft_fmt_itm_.Month_int_len2) // 01 .Add(Byte_ascii.Ltr_m , Pft_fmt_itm_.Month_int_len2) // 01
.Add(Byte_ascii.Ltr_M , Pft_fmt_itm_.Month_abrv) // Jan .Add(Byte_ascii.Ltr_M , Pft_fmt_itm_.Month_abrv) // Jan
.Add(Byte_ascii.Ltr_F , Pft_fmt_itm_.Month_name) // January .Add(Byte_ascii.Ltr_F , Pft_fmt_itm_.Month_name) // January
.Add("xg" , Pft_fmt_itm_.Month_gen) // January .Add("xg" , Pft_fmt_itm_.Month_gen) // January
.Add(Byte_ascii.Ltr_W , Pft_fmt_itm_.WeekOfYear_int_len2) // 01 .Add(Byte_ascii.Ltr_W , Pft_fmt_itm_.WeekOfYear_int_len2) // 01
.Add(Byte_ascii.Ltr_j , Pft_fmt_itm_.Day_int) // 1 .Add(Byte_ascii.Ltr_j , Pft_fmt_itm_.Day_int) // 1
.Add(Byte_ascii.Ltr_d , Pft_fmt_itm_.Day_int_len2) // 01 .Add(Byte_ascii.Ltr_d , Pft_fmt_itm_.Day_int_len2) // 01
@ -167,10 +177,10 @@ public class Pft_fmt_itm_ {
.Add("xiF" , Pft_fmt_itm_.Iranian_month_name) .Add("xiF" , Pft_fmt_itm_.Iranian_month_name)
.Add("xin" , Pft_fmt_itm_.Iranian_month_idx) .Add("xin" , Pft_fmt_itm_.Iranian_month_idx)
.Add("xiY" , Pft_fmt_itm_.Iranian_year_idx) .Add("xiY" , Pft_fmt_itm_.Iranian_year_idx)
.Add("xmj" , Pft_fmt_itm_.Hijiri_day_idx) .Add("xmj" , Pft_fmt_itm_.hijri_day_idx)
.Add("xmF" , Pft_fmt_itm_.Hijiri_month_name) .Add("xmF" , Pft_fmt_itm_.hijri_month_name)
.Add("xmn" , Pft_fmt_itm_.Hijiri_month_idx) .Add("xmn" , Pft_fmt_itm_.hijri_month_idx)
.Add("xmY" , Pft_fmt_itm_.Hijiri_year_idx) .Add("xmY" , Pft_fmt_itm_.hijri_year_idx)
// TODO_OLD: space; " // TODO_OLD: space; "
; ;

View File

@ -1,6 +1,6 @@
/* /*
XOWA: the XOWA Offline Wiki Application XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012-2017 gnosygnu@gmail.com Copyright (C) 2012-2021 gnosygnu@gmail.com
XOWA is licensed under the terms of the General Public License (GPL) Version 3, XOWA is licensed under the terms of the General Public License (GPL) Version 3,
or alternatively under the terms of the Apache License Version 2.0. or alternatively under the terms of the Apache License Version 2.0.
@ -13,8 +13,13 @@ The terms of each license can be found in the source code repository:
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
*/ */
package gplx.xowa.xtns.pfuncs.times; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.pfuncs.*; package gplx.xowa.xtns.pfuncs.times;
import gplx.xowa.langs.*;
import gplx.Bry_bfr;
import gplx.DateAdp;
import gplx.xowa.Xowe_wiki;
import gplx.xowa.langs.Xol_lang_itm;
class Pft_fmt_itm_roman implements Pft_fmt_itm { class Pft_fmt_itm_roman implements Pft_fmt_itm {
public int TypeId() {return Pft_fmt_itm_.Tid_roman;} public int TypeId() {return Pft_fmt_itm_.Tid_roman;}
public void Fmt(Bry_bfr bfr, Xowe_wiki wiki, Xol_lang_itm lang, DateAdp date, Pft_func_formatdate_bldr bldr) { public void Fmt(Bry_bfr bfr, Xowe_wiki wiki, Xol_lang_itm lang, DateAdp date, Pft_func_formatdate_bldr bldr) {
@ -120,30 +125,30 @@ class Pft_fmt_itm_iranian_month_name implements Pft_fmt_itm {
bfr.Add(Pft_fmt_itm_iranian.Get_month_name(wiki, date)); bfr.Add(Pft_fmt_itm_iranian.Get_month_name(wiki, date));
} }
} }
class Pft_fmt_itm_hijiri_year_idx implements Pft_fmt_itm { class Pft_fmt_itm_hijri_year_idx implements Pft_fmt_itm {
public int TypeId() {return Pft_fmt_itm_.Tid_hijiri_year_idx;} public int TypeId() {return Pft_fmt_itm_.Tid_hijri_year_idx;}
public void Fmt(Bry_bfr bfr, Xowe_wiki wiki, Xol_lang_itm lang, DateAdp date, Pft_func_formatdate_bldr bldr) { public void Fmt(Bry_bfr bfr, Xowe_wiki wiki, Xol_lang_itm lang, DateAdp date, Pft_func_formatdate_bldr bldr) {
int[] seg_ary = Pft_fmt_itm_hijiri.Calc_date(date); int[] seg_ary = Pft_fmt_itm_hijri.Calc_date(date);
bfr.Add_int_variable(seg_ary[Pft_fmt_itm_hijiri.Rslt__year]); bfr.Add_int_variable(seg_ary[Pft_fmt_itm_hijri.Rslt__year]);
} }
} }
class Pft_fmt_itm_hijiri_month_idx implements Pft_fmt_itm { class Pft_fmt_itm_hijri_month_idx implements Pft_fmt_itm {
public int TypeId() {return Pft_fmt_itm_.Tid_hijiri_month_idx;} public int TypeId() {return Pft_fmt_itm_.Tid_hijri_month_idx;}
public void Fmt(Bry_bfr bfr, Xowe_wiki wiki, Xol_lang_itm lang, DateAdp date, Pft_func_formatdate_bldr bldr) { public void Fmt(Bry_bfr bfr, Xowe_wiki wiki, Xol_lang_itm lang, DateAdp date, Pft_func_formatdate_bldr bldr) {
int[] seg_ary = Pft_fmt_itm_hijiri.Calc_date(date); int[] seg_ary = Pft_fmt_itm_hijri.Calc_date(date);
bfr.Add_int_variable(seg_ary[Pft_fmt_itm_hijiri.Rslt__month]); bfr.Add_int_variable(seg_ary[Pft_fmt_itm_hijri.Rslt__month]);
} }
} }
class Pft_fmt_itm_hijiri_day_idx implements Pft_fmt_itm { class Pft_fmt_itm_hijri_day_idx implements Pft_fmt_itm {
public int TypeId() {return Pft_fmt_itm_.Tid_hijiri_day_idx;} public int TypeId() {return Pft_fmt_itm_.Tid_hijri_day_idx;}
public void Fmt(Bry_bfr bfr, Xowe_wiki wiki, Xol_lang_itm lang, DateAdp date, Pft_func_formatdate_bldr bldr) { public void Fmt(Bry_bfr bfr, Xowe_wiki wiki, Xol_lang_itm lang, DateAdp date, Pft_func_formatdate_bldr bldr) {
int[] seg_ary = Pft_fmt_itm_hijiri.Calc_date(date); int[] seg_ary = Pft_fmt_itm_hijri.Calc_date(date);
bfr.Add_int_variable(seg_ary[Pft_fmt_itm_hijiri.Rslt__day]); bfr.Add_int_variable(seg_ary[Pft_fmt_itm_hijri.Rslt__day]);
} }
} }
class Pft_fmt_itm_hijiri_month_name implements Pft_fmt_itm { class Pft_fmt_itm_hijri_month_name implements Pft_fmt_itm {
public int TypeId() {return Pft_fmt_itm_.Tid_hijiri_month_name;} public int TypeId() {return Pft_fmt_itm_.Tid_hijri_month_name;}
public void Fmt(Bry_bfr bfr, Xowe_wiki wiki, Xol_lang_itm lang, DateAdp date, Pft_func_formatdate_bldr bldr) { public void Fmt(Bry_bfr bfr, Xowe_wiki wiki, Xol_lang_itm lang, DateAdp date, Pft_func_formatdate_bldr bldr) {
bfr.Add(Pft_fmt_itm_hijiri.Get_month_name(wiki, date)); bfr.Add(Pft_fmt_itm_hijri.Get_month_name(wiki, date));
} }
} }

View File

@ -1,6 +1,6 @@
/* /*
XOWA: the XOWA Offline Wiki Application XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012-2017 gnosygnu@gmail.com Copyright (C) 2012-2021 gnosygnu@gmail.com
XOWA is licensed under the terms of the General Public License (GPL) Version 3, XOWA is licensed under the terms of the General Public License (GPL) Version 3,
or alternatively under the terms of the Apache License Version 2.0. or alternatively under the terms of the Apache License Version 2.0.
@ -13,8 +13,14 @@ The terms of each license can be found in the source code repository:
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
*/ */
package gplx.xowa.xtns.pfuncs.times; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.pfuncs.*; package gplx.xowa.xtns.pfuncs.times;
class Pft_fmt_itm_hijiri {
import gplx.Bry_;
import gplx.DateAdp;
import gplx.List_adp_;
import gplx.xowa.Xowe_wiki;
class Pft_fmt_itm_hijri {
public static int[] Calc_date(DateAdp date) { public static int[] Calc_date(DateAdp date) {
int[] rv = new int[3]; // MEM:cache int[] rv = new int[3]; // MEM:cache
Calc_date(rv, date.Year(), date.Month(), date.Day()); Calc_date(rv, date.Year(), date.Month(), date.Day());
@ -58,10 +64,10 @@ class Pft_fmt_itm_hijiri {
return wiki.Msg_mgr().Val_by_key_obj(msg_key); return wiki.Msg_mgr().Val_by_key_obj(msg_key);
} }
private static final byte[][] Month_names = new byte[][] private static final byte[][] Month_names = new byte[][]
{ Bry_.new_a7("hijiri-calendar-m1"), Bry_.new_a7("hijiri-calendar-m2"), Bry_.new_a7("hijiri-calendar-m3") { Bry_.new_a7("hijri-calendar-m1"), Bry_.new_a7("hijri-calendar-m2"), Bry_.new_a7("hijri-calendar-m3")
, Bry_.new_a7("hijiri-calendar-m4"), Bry_.new_a7("hijiri-calendar-m5"), Bry_.new_a7("hijiri-calendar-m6") , Bry_.new_a7("hijri-calendar-m4"), Bry_.new_a7("hijri-calendar-m5"), Bry_.new_a7("hijri-calendar-m6")
, Bry_.new_a7("hijiri-calendar-m7"), Bry_.new_a7("hijiri-calendar-m8"), Bry_.new_a7("hijiri-calendar-m9") , Bry_.new_a7("hijri-calendar-m7"), Bry_.new_a7("hijri-calendar-m8"), Bry_.new_a7("hijri-calendar-m9")
, Bry_.new_a7("hijiri-calendar-m10"), Bry_.new_a7("hijiri-calendar-m11"), Bry_.new_a7("hijiri-calendar-m12") , Bry_.new_a7("hijri-calendar-m10"), Bry_.new_a7("hijri-calendar-m11"), Bry_.new_a7("hijri-calendar-m12")
}; };
public static final int public static final int
Rslt__year = 0 Rslt__year = 0

View File

@ -1,6 +1,6 @@
/* /*
XOWA: the XOWA Offline Wiki Application XOWA: the XOWA Offline Wiki Application
Copyright (C) 2012-2017 gnosygnu@gmail.com Copyright (C) 2012-2021 gnosygnu@gmail.com
XOWA is licensed under the terms of the General Public License (GPL) Version 3, XOWA is licensed under the terms of the General Public License (GPL) Version 3,
or alternatively under the terms of the Apache License Version 2.0. or alternatively under the terms of the Apache License Version 2.0.
@ -13,21 +13,25 @@ The terms of each license can be found in the source code repository:
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
*/ */
package gplx.xowa.xtns.pfuncs.times; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; import gplx.xowa.xtns.pfuncs.*; package gplx.xowa.xtns.pfuncs.times;
import org.junit.*;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class Pft_func_time__other__tst { public class Pft_func_time__other__tst {
@Before public void init() {fxt.Clear();} private Pft_func_time_foreign_fxt fxt = new Pft_func_time_foreign_fxt(); @Before public void init() {fxt.Clear();} private Pft_func_time_foreign_fxt fxt = new Pft_func_time_foreign_fxt();
@After public void term() {fxt.Term();} @After public void term() {fxt.Term();}
@Test public void Thai() {fxt.Test_parse("{{#time:xkY|2012}}" , "2555");} @Test public void Thai() {fxt.Test_parse("{{#time:xkY|2012}}" , "2555");}
@Test public void Minguo() {fxt.Test_parse("{{#time:xoY|2012}}" , "101");} @Test public void Minguo() {fxt.Test_parse("{{#time:xoY|2012}}" , "101");}
@Test public void Iranian__year_idx() {fxt.Test_parse("{{#time:xiY|2012-01-02}}" , "1390");} @Test public void Iranian__year_idx() {fxt.Test_parse("{{#time:xiY|2012-01-02}}" , "1390");}
@Test public void Iranian__month_idx() {fxt.Test_parse("{{#time:xin|2012-01-02}}" , "10");} @Test public void Iranian__month_idx() {fxt.Test_parse("{{#time:xin|2012-01-02}}" , "10");}
@Test public void Iranian__day_idx() {fxt.Test_parse("{{#time:xij|2012-01-02}}" , "12");} @Test public void Iranian__day_idx() {fxt.Test_parse("{{#time:xij|2012-01-02}}" , "12");}
@Test public void Iranian__month_name() {fxt.Init_msg("iranian-calendar-m10" , "Dey"); fxt.Test_parse("{{#time:xiF|2012-01-02}}" , "Dey");} @Test public void Iranian__month_name() {fxt.Init_msg("iranian-calendar-m10" , "Dey"); fxt.Test_parse("{{#time:xiF|2012-01-02}}" , "Dey");}
@Test public void Hijiri__year_idx() {fxt.Test_parse("{{#time:xmY|2012-01-02}}" , "1433");} @Test public void hijri__year_idx() {fxt.Test_parse("{{#time:xmY|2012-01-02}}" , "1433");}
@Test public void Hijiri__month_idx() {fxt.Test_parse("{{#time:xmn|2012-01-02}}" , "2");} @Test public void hijri__month_idx() {fxt.Test_parse("{{#time:xmn|2012-01-02}}" , "2");}
@Test public void Hijiri__day_idx() {fxt.Test_parse("{{#time:xmj|2012-01-02}}" , "7");} @Test public void hijri__day_idx() {fxt.Test_parse("{{#time:xmj|2012-01-02}}" , "7");}
@Test public void Hijiri__month_name() {fxt.Init_msg("hijiri-calendar-m2" , "Safar"); fxt.Test_parse("{{#time:xmF|2012-01-02}}" , "Safar");} @Test public void hijri__month_name() {fxt.Init_msg("hijri-calendar-m2" , "Safar"); fxt.Test_parse("{{#time:xmF|2012-01-02}}" , "Safar");}
@Test public void Roman__year() {fxt.Test_parse("{{#time:xrY|2012}}" , "MMXII");} @Test public void Roman__year() {fxt.Test_parse("{{#time:xrY|2012}}" , "MMXII");}
@Test public void Roman__various() { @Test public void Roman__various() {
fxt.Test_Roman( 1, "I"); fxt.Test_Roman( 1, "I");