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

Lang macro output #940

Open
opoudjis opened this issue Nov 10, 2024 · 2 comments
Open

Lang macro output #940

opoudjis opened this issue Nov 10, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@opoudjis
Copy link
Contributor

We are using the lang:[] macro in the ISO Rice document, to output variant as multilingual variants of term designations. But we have done away with the variant element, outside of organisation names, in favour of repeating the element with different languages. This was done in order to simplify the Relaton grammar.

So we don't want

[[paddy]]
=== lang:en[paddy] lang:fr[paddy]

to output

<term id="paddy">
<preferred><expression>
<name><variant lang="en">paddy</variant> <variant lang="fr">paddy</variant></name>
</expression>
</preferred>

but

<term id="paddy">
<preferred><expression>
<name lang="en">paddy</name> 
<name lang="fr">paddy</name>
</expression>
</preferred>

But this needs to be generalised. If an element contains just lang:[] variant elements, it can be converted in this way. But if we have adjacent lang:[] instances in running text, we need to wrap them into spans:

This is a lang:en[A] lang:fr[B]

to

<span lang="en">A</span> <span lang="fr">B</span> 

We don't particularly want lang:[] used outside of Semantic XML elements like terms, but we do need to cope with it if it occurs in general, now that we have got rid of variant for language variants.

Btw @ronaldtse This is part of me finding discrepancies between the grammar and the output: variant should no longer be used in this sense.

@opoudjis opoudjis added the bug Something isn't working label Nov 10, 2024
@opoudjis opoudjis self-assigned this Nov 10, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New in Metanorma Nov 10, 2024
@ronaldtse
Copy link
Contributor

Thank you @opoudjis . Does the lang attribute work with blocks and paragraphs as well?

@opoudjis
Copy link
Contributor Author

Not yet (outside of terms). In fact this is not an attribute, it is a macro for inline language-specific content.

@opoudjis opoudjis moved this from 🏗 In progress to 🏔 High priority in Metanorma Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🏔 High priority
Development

No branches or pull requests

2 participants