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

Metadata editor: alternate-script breaks the dialog #613

Closed
Carmina16 opened this issue Apr 26, 2021 · 13 comments
Closed

Metadata editor: alternate-script breaks the dialog #613

Carmina16 opened this issue Apr 26, 2021 · 13 comments

Comments

@Carmina16
Copy link

When the metadata editor is used for adding alternate-script property, it does not add the xml:lang attribute, and, if confirmed, the editor no longer opens due to Python error.

When xml:lang attribute is added manually, the dialog opens and it is represented by altlang pseudoproperty, but there seems to be no way to add it from the editor. (another part of the bug.)

@kevinhendricks
Copy link
Contributor

altlang was deprecated even before epub3 spec went final in favour of using xml:lang. As for alternate-script I will have to see what the epub 3.2 spec states.

@kevinhendricks
Copy link
Contributor

Yes, it is broken as it tries to put the xml:lang on the parent element and not on the alternate-script meta refines.
I will try to fix this.

@kevinhendricks
Copy link
Contributor

Yes, I had forgotten my altlang was just a placeholder to distinguish it from xml:lang used on the parent directly which is always possible.

I will revert my change and put it back for the next release.

Thank you for the bug report!

@kevinhendricks
Copy link
Contributor

This is now fixed in Sigil master.

Thanks!

@Carmina16
Copy link
Author

Now, when the "Alternate language" property is selected, the language list appears. But selecting an item there, the translated language name is put into xml:lang, instead of the code.

@kevinhendricks
Copy link
Contributor

In the opf? It should be converted to an xml:lang attribute on a meta tag with property “alternate-script” that refined the original meta tag such as title or creator.

@kevinhendricks
Copy link
Contributor

Please take a screen shot of MetaEditor showing exactly what you have input, then hit OK and open the OPF in CodeView and snap a screenshot of the generated metadata and post it here.

That way I can see exactly what is happening.

Thanks.

@kevinhendricks kevinhendricks reopened this May 7, 2021
@Carmina16
Copy link
Author

  <dc:title id="tle">Title</dc:title>
  <meta refines="#tle" property="alternate-script" xml:lang="Немецкий">Title2</meta>

image
The text was provided by the language selector dialog.

@kevinhendricks
Copy link
Contributor

Okay, I understand the problem. I am obviously missing a call to convert the translated value back to the proper language code.

I will fix that today and let you know when pushed to master.

@kevinhendricks
Copy link
Contributor

Just pushed a fix for this to master. It should have been part of the previous fix for this bug but was missed.

Please let me know if it still causes you any problems.

Thanks for the bug report!

@Carmina16
Copy link
Author

Yes, it works now. A little detail: is it possible to add that property automatically when the alternate-script is added?

@kevinhendricks
Copy link
Contributor

I will look into it. That should be doable.

@kevinhendricks
Copy link
Contributor

Just pushed this to master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants