Skip to content

Commit

Permalink
Rename "declension" to "variants"
Browse files Browse the repository at this point in the history
  • Loading branch information
gusbrs committed Nov 24, 2024
1 parent 5162fe6 commit f01b261
Show file tree
Hide file tree
Showing 24 changed files with 570 additions and 545 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

## [Unreleased](https://github.com/gusbrs/zref-clever/compare/v0.4.9...HEAD)

### Changed
- The `declension` option from `\zcDeclareLanguage`, the `case` option from
`\zcLanguageSetup`, and the `d` general option (from `\zcref`) have been
renamed to `variants`, `variant`, and `v`, respectively. This is a
"semantic generalization" of the existing infrastructure. In other words,
the package now interprets more broadly type name variants, which can be
used for any language-specific needs and not just declension cases. See
discussion at issue [#35](https://github.com/gusbrs/zref-clever/issues/35).

### Deprecated
- The `declension` option from `\zcDeclareLanguage`, the `case` option from
`\zcLanguageSetup`, and the `d` general option (from `\zcref`) have been
deprecated in favor of their new names.

## [v0.4.9](https://github.com/gusbrs/zref-clever/compare/v0.4.8...v0.4.9) (2024-11-16)

### Changed
Expand Down
28 changes: 14 additions & 14 deletions testfiles/zc-LanguageSetup01.lvt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
\BEGINTEST{Options and scopes: default, type-specific}
\zcLanguageSetup{ngerman}{
gender=m,
case=D,
variant=D,
tpairsep={ t\& },
tlistsep={,,, },
tlastsep={ tUND },
Expand All @@ -55,7 +55,7 @@
name-pl-ab=bs.,
type=section,
gender=m,
case=D,
variant=D,
tpairsep={ \& },
tlistsep={,, },
tlastsep={ AND },
Expand Down Expand Up @@ -164,11 +164,11 @@
\ExplSyntaxOff
\ENDTEST

\BEGINTEST{Missing case and gender}
\BEGINTEST{Missing variant and gender}
\zcLanguageSetup{english}{
type=section,
gender=m,
case=D,
variant=D,
}
\zcLanguageSetup{french}{
type=section,
Expand Down Expand Up @@ -565,47 +565,47 @@
\box0
\ENDTEST

\newoptblock{[Nn]ame-[sg/pl](-ab)=... (german,d=D)}
\newoptblock{[Nn]ame-[sg/pl](-ab)=... (german,v=D)}

\BEGINTEST{Option: [Nn]ame-[sg/pl](-ab)=... (german,d=D)}
\BEGINTEST{Option: [Nn]ame-[sg/pl](-ab)=... (german,v=D)}
\selectlanguage{ngerman}
\renewcommand{\testtmp}{%
\zcref[cap,noabbrev,d=D]{sec:section-1.1}}
\zcref[cap,noabbrev,v=D]{sec:section-1.1}}
\setbox0=\hbox{\testtmp}
\showbox0
\box0
\renewcommand{\testtmp}{%
\zcref[noabbrev,d=D]{sec:section-1.1}}
\zcref[noabbrev,v=D]{sec:section-1.1}}
\setbox0=\hbox{\testtmp}
\showbox0
\box0
\renewcommand{\testtmp}{%
\zcref[cap,noabbrev,d=D]{sec:section-1.1, sec:section-1.2}}
\zcref[cap,noabbrev,v=D]{sec:section-1.1, sec:section-1.2}}
\setbox0=\hbox{\testtmp}
\showbox0
\box0
\renewcommand{\testtmp}{%
\zcref[noabbrev,d=D]{sec:section-1.1, sec:section-1.2}}
\zcref[noabbrev,v=D]{sec:section-1.1, sec:section-1.2}}
\setbox0=\hbox{\testtmp}
\showbox0
\box0
\renewcommand{\testtmp}{%
\zcref[cap,abbrev,d=D]{sec:section-1.1}}
\zcref[cap,abbrev,v=D]{sec:section-1.1}}
\setbox0=\hbox{\testtmp}
\showbox0
\box0
\renewcommand{\testtmp}{%
\zcref[abbrev,d=D]{sec:section-1.1}}
\zcref[abbrev,v=D]{sec:section-1.1}}
\setbox0=\hbox{\testtmp}
\showbox0
\box0
\renewcommand{\testtmp}{%
\zcref[cap,abbrev,d=D]{sec:section-1.1, sec:section-1.2}}
\zcref[cap,abbrev,v=D]{sec:section-1.1, sec:section-1.2}}
\setbox0=\hbox{\testtmp}
\showbox0
\box0
\renewcommand{\testtmp}{%
\zcref[abbrev,d=D]{sec:section-1.1, sec:section-1.2}}
\zcref[abbrev,v=D]{sec:section-1.1, sec:section-1.2}}
\setbox0=\hbox{\testtmp}
\showbox0
\box0
Expand Down
6 changes: 3 additions & 3 deletions testfiles/zc-LanguageSetup01.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@ The sequence \g__zrefclever_opt_lang_german_type_section_refbounds-last-re_seq c
l. ... }
============================================================
============================================================
TEST 2: Missing case and gender
TEST 2: Missing variant and gender
============================================================
Package zref-clever Warning: Language 'english' has no declared gender on line .... Nothing to do with option 'gender=m'.
Package zref-clever Warning: Language 'english' has no declared declension cases on line .... Nothing to do with option 'case=D'.
Package zref-clever Warning: Language 'english' has no declared variants on line .... Nothing to do with option 'variant=D'.
Package zref-clever Warning: Language 'french' has no 'n' gender declared on line ....
============================================================
============================================================
Expand Down Expand Up @@ -1023,7 +1023,7 @@ l. ...\setbox0=\hbox{\testtmp
l. ...\showbox0
============================================================
============================================================
TEST 13: Option: [Nn]ame-[sg/pl](-ab)=... (german,d=D)
TEST 13: Option: [Nn]ame-[sg/pl](-ab)=... (german,v=D)
============================================================
(zref-clever-german.lang)
Package zref-clever Info: Loaded 'german' language file.
Expand Down
6 changes: 3 additions & 3 deletions testfiles/zc-LanguageSetup01.xetex.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@ The sequence \g__zrefclever_opt_lang_german_type_section_refbounds-last-re_seq c
l. ... }
============================================================
============================================================
TEST 2: Missing case and gender
TEST 2: Missing variant and gender
============================================================
Package zref-clever Warning: Language 'english' has no declared gender on line .... Nothing to do with option 'gender=m'.
Package zref-clever Warning: Language 'english' has no declared declension cases on line .... Nothing to do with option 'case=D'.
Package zref-clever Warning: Language 'english' has no declared variants on line .... Nothing to do with option 'variant=D'.
Package zref-clever Warning: Language 'french' has no 'n' gender declared on line ....
============================================================
============================================================
Expand Down Expand Up @@ -1023,7 +1023,7 @@ l. ...\setbox0=\hbox{\testtmp
l. ...\showbox0
============================================================
============================================================
TEST 13: Option: [Nn]ame-[sg/pl](-ab)=... (german,d=D)
TEST 13: Option: [Nn]ame-[sg/pl](-ab)=... (german,v=D)
============================================================
(zref-clever-german.lang)
Package zref-clever Info: Loaded 'german' language file.
Expand Down
8 changes: 4 additions & 4 deletions testfiles/zc-langfile-dutch01.lvt
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
}
\seq_if_exist:cT
{ \__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
{
\seq_show:c
{
\__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
}
\seq_if_exist:cT
Expand Down Expand Up @@ -146,13 +146,13 @@
\seq_if_exist:cTF
{
\__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
{
\seq_map_inline:cn
{
\__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
{
\clist_map_inline:nn
Expand Down
8 changes: 4 additions & 4 deletions testfiles/zc-langfile-english01.lvt
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
}
\seq_if_exist:cT
{ \__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
{
\seq_show:c
{
\__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
}
\seq_if_exist:cT
Expand Down Expand Up @@ -153,13 +153,13 @@
\seq_if_exist:cTF
{
\__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
{
\seq_map_inline:cn
{
\__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
{
\clist_map_inline:nn
Expand Down
8 changes: 4 additions & 4 deletions testfiles/zc-langfile-french01.lvt
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
}
\seq_if_exist:cT
{ \__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
{
\seq_show:c
{
\__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
}
\seq_if_exist:cT
Expand Down Expand Up @@ -147,13 +147,13 @@
\seq_if_exist:cTF
{
\__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
{
\seq_map_inline:cn
{
\__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
{
\clist_map_inline:nn
Expand Down
8 changes: 4 additions & 4 deletions testfiles/zc-langfile-german01.lvt
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
}
\seq_if_exist:cT
{ \__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
{
\seq_show:c
{
\__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
}
\seq_if_exist:cT
Expand Down Expand Up @@ -151,13 +151,13 @@
\seq_if_exist:cTF
{
\__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
{
\seq_map_inline:cn
{
\__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
{
\clist_map_inline:nn
Expand Down
2 changes: 1 addition & 1 deletion testfiles/zc-langfile-german01.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ l. ... }
> \g__zrefclever_declared_language_nswissgerman_tl=german.
<recently read> }
l. ... }
The sequence \g__zrefclever_opt_language_german_declension_seq contains the items (without outer braces):
The sequence \g__zrefclever_opt_language_german_variants_seq contains the items (without outer braces):
> {N}
> {A}
> {D}
Expand Down
8 changes: 4 additions & 4 deletions testfiles/zc-langfile-italian01.lvt
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
}
\seq_if_exist:cT
{ \__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
{
\seq_show:c
{
\__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
}
\seq_if_exist:cT
Expand Down Expand Up @@ -173,13 +173,13 @@
\seq_if_exist:cTF
{
\__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
{
\seq_map_inline:cn
{
\__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
{
\clist_map_inline:nn
Expand Down
8 changes: 4 additions & 4 deletions testfiles/zc-langfile-portuguese01.lvt
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
}
\seq_if_exist:cT
{ \__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
{
\seq_show:c
{
\__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
}
\seq_if_exist:cT
Expand Down Expand Up @@ -149,13 +149,13 @@
\seq_if_exist:cTF
{
\__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
{
\seq_map_inline:cn
{
\__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
{
\clist_map_inline:nn
Expand Down
8 changes: 4 additions & 4 deletions testfiles/zc-langfile-russian01.lvt
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
}
\seq_if_exist:cT
{ \__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
{
\seq_show:c
{
\__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
}
\seq_if_exist:cT
Expand Down Expand Up @@ -166,13 +166,13 @@
\seq_if_exist:cTF
{
\__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
{
\seq_map_inline:cn
{
\__zrefclever_opt_varname_language:enn
{ \g__test_tmpa_tl } { declension } { seq }
{ \g__test_tmpa_tl } { variants } { seq }
}
{
\clist_map_inline:nn
Expand Down
2 changes: 1 addition & 1 deletion testfiles/zc-langfile-russian01.tlg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ TEST 1: Language declaration
> \g__zrefclever_declared_language_russian_tl=russian.
<recently read> }
l. ... }
The sequence \g__zrefclever_opt_language_russian_declension_seq contains the items (without outer braces):
The sequence \g__zrefclever_opt_language_russian_variants_seq contains the items (without outer braces):
> {n}
> {a}
> {g}
Expand Down
Loading

0 comments on commit f01b261

Please sign in to comment.