Open awvwgk opened 2 years ago
I would be interested in contributing a fix for this issue. What would be a good place to start looking for the source of this problem?
Poking around a bit I found that a button-ref
without content can be translated just fine
:::{button-ref} ref
:ref-type: ref
:outline:
:::
While having content will result in the above behaviour
:::{button-ref} ref
:ref-type: ref
:outline:
Some text
:::
Therefore, my naive guess would be that this is related to the way the content added. Would the piece linked below be the right place to start looking?
I'd also like to help get this fixed. Are there any resources you could point me on handling translations with directives? Or an existing workaround that needs testing?
Related: #96
Hey there, any progress on this?
Hi, @OriolAbril, nice to see you in the thread
Describe the problem
CSS classes are dropped from button-ref when translating the label. The gettext replacement should only replace the button label rather than the complete directive creating the button.
Link to your repository or website
https://github.com/awvwgk/fpm-docs/blob/main/pages/index.md
Steps to reproduce
Steps to reproduce
``` ❯ cat index.md # Test :::{button-ref} ref :ref-type: ref :outline: Some text ::: (ref)= ## Header ❯ cat conf.py project = "test" extensions = [ "myst_parser", "sphinx_design", ] myst_enable_extensions = [ "colon_fence", "deflist", "substitution", "html_image", ] html_theme = "sphinx_book_theme" locale_dirs = ["locales/"] ❯ sphinx-build . _build/html -b html Running Sphinx v4.3.0 loading pickled environment... done myst v0.15.2: MdParserConfig(renderer='sphinx', commonmark_only=False, enable_extensions=['colon_fence', 'deflist', 'substitution', 'html_image'], dmath_allow_labels=True, dmath_allow_space=True, dmath_allow_digits=True, dmath_double_inline=False, update_mathjax=True, mathjax_classes='tex2jax_process|mathjax_process|math|output_area', disable_syntax=[], url_schemes=['http', 'https', 'mailto', 'ftp'], heading_anchors=None, heading_slug_func=None, html_meta=[], footnote_transition=True, substitutions=[], sub_delimiters=['{', '}'], words_per_minute=200) building [mo]: targets for 0 po files that are out of date building [html]: targets for 1 source files that are out of date updating environment: 0 added, 1 changed, 0 removed reading sources... [100%] index looking for now-outdated files... none found pickling environment... done checking consistency... done preparing documents... done writing output... [100%] index generating indices... genindex done writing additional pages... search done copying static files... done copying extra files... done dumping search index in English (code: en)... done dumping object inventory... done build succeeded. The HTML pages are in _build/html. ❯ cat locales/de/LC_MESSAGES/index.po # SOME DESCRIPTIVE TITLE. # Copyright (C) # This file is distributed under the same license as the test package. # FIRST AUTHOROriginal document:
Translated
button-ref
:The version of Python you're using
3.9.7
Your operating system
Linux
Versions of your packages
Environment file: https://github.com/awvwgk/fpm-docs/blob/main/environment.yaml
Additional context
No response