Skip to content

Commit

Permalink
feat: localisation for siunitx
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexaraWu committed Sep 25, 2023
1 parent 07bf7db commit 5d257ea
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions sjtutex/source/sjtutex.dtx
Original file line number Diff line number Diff line change
Expand Up @@ -4194,6 +4194,7 @@
}
\cs_new_protected:Nn \@@_set_language_zh:
{
\tl_set:Nn \languagename { chinese }
\ctex_set:n { autoindent = true }
\@@_set_cjk_default_zh:
\normalfont
Expand All @@ -4203,6 +4204,8 @@
%<en>\cs_new_protected:Nn \@@_set_language_en:
%<de>\cs_new_protected:Nn \@@_set_language_de:
{
%<en> \tl_set:Nn \languagename { english }
%<de> \tl_set:Nn \languagename { ngerman }
\ctex_set:n { autoindent = 1.5 em }
\normalfont
}
Expand All @@ -4216,6 +4219,7 @@
}
\cs_new_protected:Nn \@@_set_language_ja:
{
\tl_set:Nn \languagename { japanese }
\ctex_set:n { autoindent = 1 }
\@@_set_cjk_default_ja:
\normalfont
Expand Down Expand Up @@ -4248,6 +4252,16 @@
%</lang>
% \end{macrocode}
%
% 初始化语言名称。
% \begin{macrocode}
%<*scheme>
%<zh>\tl_set:Nn \languagename { chinese }
%<en>\tl_set:Nn \languagename { english }
%<de>\tl_set:Nn \languagename { ngerman }
%<ja>\tl_set:Nn \languagename { japanese }
%</scheme>
% \end{macrocode}
%
% 载入语言配置。
% \begin{macrocode}
%<*class>
Expand Down Expand Up @@ -5316,6 +5330,30 @@
{ \tl_set:Nn \nomname { \SJTU@nomname } }
% \end{macrocode}
%
% \changes{unreleased}{2023/09/25}{添加 \pkg{siunitx} 本地化支持。}
% \subsubsection{\pkg{translations} 宏包}
% \begin{macrocode}
\ctex_at_end_package:nn { translations }
{
\DeclareLanguage { chinese }
\DeclareLanguageAlias { Chinese } { chinese }
}
% \end{macrocode}
%
% \subsubsection{\pkg{siunitx} 宏包}
% \begin{macrocode}
\ctex_at_end_package:nn { siunitx }
{
\@ifpackageloaded { translations }
{
\DeclareTranslation { Chinese } { and } { 和 }
\DeclareTranslation { Japanese } { and } { と }
\DeclareTranslation { Chinese } { to~(numerical~range) } { \textasciitilde }
\DeclareTranslation { Japanese } { to~(numerical~range) } { \textasciitilde }
} { }
}
% \end{macrocode}
%
% \begin{macrocode}
%</class>
% \end{macrocode}
Expand Down

0 comments on commit 5d257ea

Please sign in to comment.