Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phrase about edition superseding #1103

Closed
Intelligent2013 opened this issue Feb 14, 2024 · 5 comments
Closed

Phrase about edition superseding #1103

Intelligent2013 opened this issue Feb 14, 2024 · 5 comments
Assignees

Comments

@Intelligent2013
Copy link
Contributor

Source issue: #1089

The 2nd, etc. ISO publications from 1951 to 1971 contains the sentence about superseding the previous edition.
Need to add the localized resource.

Examples:

  • 'en' - This second edition supersedes the first edition
    image

  • 'fr' - Cette deuxième édition annule et remplace la première édition
    image

@opoudjis
Copy link
Contributor

Is the phrase more generally "This n-th edition supersedes the n-1-th edition"? I'd have to assume so...

@Intelligent2013
Copy link
Contributor Author

Is the phrase more generally "This n-th edition supersedes the n-1-th edition"? I'd have to assume so...

@opoudjis yes, sure.

@opoudjis
Copy link
Contributor

For Russian, this will become the very first time we will have had to allow for case inflection in i18n (we will need both nominative and accusative). I will need to work out whether I hard code casing in i18n processing, or build a metalanguage like Fluent (if not Fluent itself) into the template. But unless we do a lot more Russian than we have been doing, that would be overengineering.

If it's Настоящее второе издание заменяет первое издание, then I see "edition" is neuter, with the same inflection for nominative and accusative, so in this one instance, I would not need to build case inflection. But that's a happy accident, and I want to be safe...

@opoudjis
Copy link
Contributor

opoudjis commented Feb 17, 2024

Again, while this solution is overkill for this instance ("edition" in Russian is neuter, so it's the same in the nominative and accusative), I'm using this as an opportunity to refactor i18n.

The current uninflected (so nominative) i18n templates for "first edition" and "1st EDITION" in Russian are:

  • edition_ordinal: "%Spellout ИЗДАНИЕ"
  • edition_ordinal_old: "%Ordinal ИЗДАНИЕ"

%Spellout and %Ordinal are special variables, to be populated from metadata, and formatted according to the word after %, and twitter-cldr-rb.

We have variables in general in our YAML, indicated by %, %1, %2, etc.

We now need to introduce case inflection on variables, and on words that already occur in our i18n.

Fluent https://projectfluent.org/fluent/guide/terms.html would express the case for "This n-th edition supersedes the n-1-th edition" as:

ordinal_edition = { NUMBER($edition, type: "ordinal") ->
   [1] You finished first!
   [one] You finished {$pos}st
   [two] You finished {$pos}nd
   [few] You finished {$pos}rd
  *[other] You finished {$pos}th
}


-this(case: "nominative", gender: "neuter") 
-ordinal_edition(case: "nominative", gender: "neuter", number: "singular") 
{ -edition(case: "nominative") ... }

Fluent... as I said, does not actually do that much, other than passing attributes into the i18n word lookup. We're not going to get that much out of adopting it.

But it's clear that we should add the following functionality to our i18n manipulation of YAML:

  • Variables to be resolved in code, which should be cleaner than % vs %1 %2 (I've recently already run into trouble with that conflict); I'm reluctant to overhaul this to $1 $2 $3, but I'm ok to overhaul this to %1 %2 %3
  • Allow always for Liquid markup using the variables extracted in the Isodoc::Metadata class for this document, as {{ ... }}
  • Grammatical parameters on variables, which can be resolved by selecting for inflection; the functionality for selecting on grammatical information is already in place, but selectors at the moment are hard-coded.
  • The special variables %Ordinal %Spellout should instead be functions, to allow them to be applied to more than one variable.

With a conservative approach (allowing words to remain hard-coded if they do not vary), and allowing default values (which isodoc-i18n already knows about, given INFLECTION_ORDER = %i(voice mood tense number case gender person).freeze ), we can do:

Настоящее %Ordinal(nom) издание заменяет %Ordinal(acc) издание

If we unify variables and Liquid, and allow dynamic entry of word inflection, as a maximimalist solution, we end up with:

variable1 = ...edition
variable2 = ...edition - 1

{{ labels["this"] | inflect: sg,nom,neut }} 
{{ variable1 | ordinal | inflect: sg,nom,neut }} {{ labels["edition"] | inflect: sg,nom }} 
{{ labels["replace" | inflect: act,ind,pres,sg,3rd }} 
{{ variable2 | ordinal | inflect: sg,acc,neut }} {{ labels["edition"] | inflect: sg,acc }}

This is overkill. But if we do serious work with Russian or Arabic, we need this level of overkill; and even if we don't, we should not perpetuate ad hoc solutions to inflection. The solution I'll implement will be more conservative, and it will still make the foregoing possible:

variable1 = ...edition
variable2 = ...edition - 1

Настоящее {{ variable1 | ordinal | inflect: sg,nom,neut }} 
издание заменяет 
{{ variable2 | ordinal | inflect: sg,acc,neut }} издание

And I will gradually or suddenly replace %, %1, %2 with {{variable1}}, {{variable2}} in i18n.

opoudjis added a commit to metanorma/isodoc-i18n that referenced this issue Feb 17, 2024
opoudjis added a commit to metanorma/isodoc-i18n that referenced this issue Feb 17, 2024
opoudjis added a commit to relaton/relaton-render that referenced this issue Feb 17, 2024
opoudjis added a commit to relaton/relaton-render that referenced this issue Feb 17, 2024
opoudjis added a commit to metanorma/isodoc that referenced this issue Feb 17, 2024
opoudjis added a commit that referenced this issue Feb 17, 2024
opoudjis added a commit to metanorma/isodoc that referenced this issue Feb 17, 2024
opoudjis added a commit to metanorma/isodoc that referenced this issue Feb 17, 2024
@opoudjis
Copy link
Contributor

Done:

<bibdata>
...
<ext>
...
<edn-replacement>Настоящее второе издание заменяет первое издание</edn-replacement>
</ext>
</bibdata>

Element will only appear if edition is > 1 and document scheme is 1951

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants