From b48b6def4e428b666a9228311597699be66a67d1 Mon Sep 17 00:00:00 2001 From: gnosygnu Date: Sun, 26 May 2019 09:18:11 -0400 Subject: [PATCH] Xtn.Translate: Add #translation function with no implementation [#445] --- .../src/gplx/xowa/langs/Xol_lang_itm_.java | 1 + .../gplx/xowa/langs/kwds/Xol_kwd_grp_.java | 4 ++- .../src/gplx/xowa/xtns/pfuncs/Pf_func_.java | 2 ++ .../xtns/translates/Translation_func.java | 25 +++++++++++++++++++ .../xtns/translates/Translation_func_tst.java | 22 ++++++++++++++++ 5 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 400_xowa/src/gplx/xowa/xtns/translates/Translation_func.java create mode 100644 400_xowa/src/gplx/xowa/xtns/translates/Translation_func_tst.java diff --git a/400_xowa/src/gplx/xowa/langs/Xol_lang_itm_.java b/400_xowa/src/gplx/xowa/langs/Xol_lang_itm_.java index 502918660..3ec2bef94 100644 --- a/400_xowa/src/gplx/xowa/langs/Xol_lang_itm_.java +++ b/400_xowa/src/gplx/xowa/langs/Xol_lang_itm_.java @@ -274,5 +274,6 @@ kwd_mgr.New(Bool_.N, Xol_kwd_grp_.Id_new_window_link, "#NewWindowLink"); kwd_mgr.New(Bool_.N, Xol_kwd_grp_.Id_categorytree, "#categorytree"); kwd_mgr.New(Bool_.N, Xol_kwd_grp_.Id_assessment, "#assessment"); kwd_mgr.New(Bool_.N, Xol_kwd_grp_.Id_statements, "#statements"); +kwd_mgr.New(Bool_.N, Xol_kwd_grp_.Id_translation, "#translation"); } } diff --git a/400_xowa/src/gplx/xowa/langs/kwds/Xol_kwd_grp_.java b/400_xowa/src/gplx/xowa/langs/kwds/Xol_kwd_grp_.java index a5e979c6f..0cc9a0b0f 100644 --- a/400_xowa/src/gplx/xowa/langs/kwds/Xol_kwd_grp_.java +++ b/400_xowa/src/gplx/xowa/langs/kwds/Xol_kwd_grp_.java @@ -236,8 +236,9 @@ public static final int , Id_ttl_root_txt = 216 , Id_ttl_root_url = 217 , Id_statements = 218 +, Id_translation = 219 ; -public static final int Id__max = 219; +public static final int Id__max = 220; private static byte[] ary_itm_(int id) { switch (id) { @@ -460,6 +461,7 @@ case Xol_kwd_grp_.Id_new_window_link: return Bry_.new_u8("newwindowlink"); case Xol_kwd_grp_.Id_categorytree: return Bry_.new_u8("categorytree"); case Xol_kwd_grp_.Id_assessment: return Bry_.new_u8("assessment"); case Xol_kwd_grp_.Id_statements: return Bry_.new_u8("statements"); +case Xol_kwd_grp_.Id_translation: return Bry_.new_u8("translation"); default: throw Err_.new_unhandled(id); } } diff --git a/400_xowa/src/gplx/xowa/xtns/pfuncs/Pf_func_.java b/400_xowa/src/gplx/xowa/xtns/pfuncs/Pf_func_.java index 6fef9eac0..e01b7a38a 100644 --- a/400_xowa/src/gplx/xowa/xtns/pfuncs/Pf_func_.java +++ b/400_xowa/src/gplx/xowa/xtns/pfuncs/Pf_func_.java @@ -257,6 +257,7 @@ public class Pf_func_ { , Xol_kwd_grp_.Id_categorytree , Xol_kwd_grp_.Id_assessment , Xol_kwd_grp_.Id_statements + , Xol_kwd_grp_.Id_translation }; public static Xot_defn Get_prototype(int id) { switch (id) { @@ -439,6 +440,7 @@ public class Pf_func_ { return new Pf_func_noop(id); case Xol_kwd_grp_.Id_bang: return Pf_func_bang.Instance; case Xol_kwd_grp_.Id_assessment: return gplx.xowa.xtns.assessments.Assessment_func.Instance; + case Xol_kwd_grp_.Id_translation: return gplx.xowa.xtns.translates.Translation_func.Instance; default: throw Err_.new_unhandled(id); } } diff --git a/400_xowa/src/gplx/xowa/xtns/translates/Translation_func.java b/400_xowa/src/gplx/xowa/xtns/translates/Translation_func.java new file mode 100644 index 000000000..e6defab17 --- /dev/null +++ b/400_xowa/src/gplx/xowa/xtns/translates/Translation_func.java @@ -0,0 +1,25 @@ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +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. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +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 +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.xowa.xtns.translates; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; +import gplx.xowa.xtns.pfuncs.*; +import gplx.xowa.langs.kwds.*; +import gplx.xowa.parsers.*; import gplx.xowa.parsers.tmpls.*; +public class Translation_func extends Pf_func_base { + @Override public void Func_evaluate(Bry_bfr bfr, Xop_ctx ctx, Xot_invk caller, Xot_invk self, byte[] src) {} // NOOP: could not find implementation; ISSUE#:445 DATE:2019-05-26 + @Override public int Id() {return Xol_kwd_grp_.Id_translation;} + @Override public Pf_func New(int id, byte[] name) {return new Translation_func().Name_(name);} + public static final Translation_func Instance = new Translation_func(); Translation_func() {} +} diff --git a/400_xowa/src/gplx/xowa/xtns/translates/Translation_func_tst.java b/400_xowa/src/gplx/xowa/xtns/translates/Translation_func_tst.java new file mode 100644 index 000000000..3f1c70057 --- /dev/null +++ b/400_xowa/src/gplx/xowa/xtns/translates/Translation_func_tst.java @@ -0,0 +1,22 @@ +/* +XOWA: the XOWA Offline Wiki Application +Copyright (C) 2012-2017 gnosygnu@gmail.com + +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. + +You may use XOWA according to either of these licenses as is most appropriate +for your project on a case-by-case basis. + +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 +Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt +*/ +package gplx.xowa.xtns.translates; import gplx.*; import gplx.xowa.*; import gplx.xowa.xtns.*; +import org.junit.*; +public class Translation_func_tst { + private final Xop_fxt fxt = new Xop_fxt(); + @Before public void init() {fxt.Reset();} + @Test public void Basic() {fxt.Test__parse__tmpl_to_html("{{#translation}}", "");} +}