-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
YAML lang attribute not working in ODT #1667
Comments
@jgm, @mpickering, just in case it might help, I attach a list that contains the equivalences between ISO-639 language codes used in HTML and ConTeXt language codes (they differ from LaTeX ones).
|
A workaround for different language names in ConTeXt is to define language synonyms with their XML variants (I added only the required ones):
|
There is a good article about setting the language in docx: https://social.msdn.microsoft.com/Forums/office/en-US/22e59387-8b00-4436-aa70-8372b3fc560a/how-to-change-openxml-word-document-language-culture-info?forum=oxmlsdk I've changed my template.docx accordingly and it works great. Setting the |
styles.xml right? Some docs I found helpful (relevant to docx): |
@tolot27, could you explain why do you need to set docx language? I just use default one for documents with other locales and experience no problems whatsoever (maybe I haven't encountered them though), since word's language autodetection is pretty good, at least for my case. |
@nkalvi explained it comprehensively. For my private documents I keep language autodetection on, but for all my other scientific and technical documents I switch it of because it does not work well. |
I should probably take a stab at this before 1.14 release... |
This is fixed in ConTeXt, LaTeX and HTML with #2369, but not for ODT docx etc. |
Confirming that for docx, we need to put the language in for en-US in the docDefaults section of styles.xml. Similarly in odt: in odt/styles.xml, there's a style:default-style element with
Note that language and country need to be separated out here. |
I started looking into this but got only about this far:
Couldn't figure out how to appropriately modify |
@mb21 Looks like styledoc is parsed by Text.XML.Light's parseXml, so you'd use that library to manipulate it. |
@mb21 are you still working on this? |
@jgm Feel free to take over, I won't have time for at least another week... you can see where I got stuck battling |
I got this far (it compiles but doesn't seem to work; I don't have time to investigate why right now):
You also need to add |
@jgm Looks like I got your code to work. Mainly, |
Now this is fixed for docx. (I think - testing always welcome!) |
Does anyone know what needs to be done to set the document language in ODT? |
I just looked into the spec.
|
If I understand correctly, this is only about setting the language in the writer, right? I've never touched that one. But if I remember correctly the ODT reader
So any part of the reader is unlikely to help here. Or to put it positively, there's nothing restricting anyone to that XMLConverter-stuff. |
Hello!
Could anyone help developing the pandoc tool, namely ODT generation?
On Fri, 23 Jun 2017, John MacFarlane wrote:
Does anyone know what needs to be done to set the document language in ODT?
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#1667 (comment)
(x-posted to https://stackoverflow.com/q/44737174/94687 ,
https://lists.altlinux.org/pipermail/community/2017-June/thread.html ,
https://lists.altlinux.org/pipermail/community-en/2017-June/thread.html )
…--
Best regards,
Ivan
|
The German Wikipedia entry for OpenDocument has an example[1] for explaining the ODT format. In the
...hope that helps. -- answer by Wolf [1] Permanent link: |
Just a comment. ODT languages (either for the whole document or for a part of it) require both language and country. I mean, these are recognized:
But these aren’t recognized:
Only to name a few, in both cases. |
This improves on the last commit, which didn't work in some important ways. See #1667.
dublincore:language specifies to use BCP 47 (which is currently basically RFC 5646).... so according to the spec the country shouldn't be needed, right? Maybe real-life implementations require it though... |
Be aware this is important for accessibility. Blind users who use special software that speaks the text on the screen aloud get confused by this. By default, such software switches the speech to whatever language the document declares. So, when opening a polish document, on a polish system, with a polish synthesizer set as the default, the document will be read in english, making it completely impossible to understand. Advanced computer users can turn this off, but not everyone is aware that such a possibility exists. |
@devil418 yes it's important -- but this issue has been closed as fixed. |
From #1614, i think that
lang
attribute should set document language in (at least) ConTeXt,.docx
and.odt
.Sample file:
At least with version 1.12.3.3, language attribute isn’t set for ConTeXt, ODF or OOXML documents.
I think this should be improved.
Many thanks for your excellent work.
The text was updated successfully, but these errors were encountered: