-
Notifications
You must be signed in to change notification settings - Fork 396
Se agrega redirección al codigo en ./overrides #1108
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
Conversation
actualmente se redirecciona el código a los .po, pero no se redirecciona a los .rst de .overrides/ Se agrega un if para saber si sourcename es .rst o .po
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gracias @eamanu , es algo que estaba planeando hacer, pero me ganaste
@aroquega Millll disculpas!!! esta mañana vi el issue y no volví a ver mas el ticket, recién veo que has comentado hace 4 horas- |
No hay problema, ni siquiera me compilaba la documentación e iba intentar, gracias @eamanu por hacerlo. |
@aroquega No me ha funcionado. Quieres abrir un PR Nuevo? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mejor dejo que los expertos en jinja revisen este pr
Me alegra que hayas pensado algo similar a lo que había escrito, hay que verificar cual es la extensión de sourcename, ya que no por las puras están reemplazando .rst.txt |
Era noma comparar con .rst.txt en el endswith, no es necesario que haga otro pr, 👍 |
No me ha funcionado, no veo que venga el soucename, de una manera que pueda diferenciarlas |
Tienes razón 😞 |
@eamanu crees que page_source_suffix muestre el sufijo correcto? |
Hace unos días estuve trasteando con esto un rato, creo recordar que |
Yo tampoco, yo creo que otra forma es verificar si es orphano y no es el index, puede ser ya que lo .overrides son huerfanos y la traducción está siempre en una categoría. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Genial!
@@ -4,9 +4,16 @@ <h3>{{ _('This Page') }}</h3> | |||
<ul class="this-page-menu"> | |||
<li><a href="{{ pathto('bugs') }}">{% trans %}Report a Bug{% endtrans %}</a></li> | |||
<li> | |||
{{sourcename}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we don't need to show the source name here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@humitos Si, esto es que estuve probando, a ver que me venía.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me equivoqué antes, y no funciona :)
@@ -4,9 +4,16 @@ <h3>{{ _('This Page') }}</h3> | |||
<ul class="this-page-menu"> | |||
<li><a href="{{ pathto('bugs') }}">{% trans %}Report a Bug{% endtrans %}</a></li> | |||
<li> | |||
{{sourcename}} | |||
{% if sourcename.endswith('.rst') %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Este if debería comprobar si contiene overrides
en vez, ya que todos los sourcename
terminan en .txt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Es que en sourcename no llega nada más que el nombre del archivo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
El problema es que, como comenta eamanu sourcename
, no parece ser de ayuda alguna, es simplemente la ruta de la forma "library/sys.rst.txt"
, "CONTRIBUTING.rst.txt"
, etc. Para los que están en .overrides
parece que da la ruta una vez copiados recursivamente por lo que .overrides
no aparece por ningún lado... Un poco a la desesperada, probé con page_source_suffix
, incluso con pathto
, pero igual. La idea de usar la característica de que todos son huérfanos, como comentaba aroquega arriba, creo que tiene el problema de que hay algunos que no están en .overrides
(como glossary).
Como comentaba arriba, al final la única solución que encontré fue la misma que plantea @aroquega en la PR #1111, la siempre efectiva fuerza bruta, aunque no pierdo la esperanza de que exista una opción más "elegante" :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sí, a menos que @eamanu encuentre una variable o filtro que te lleve al archivo fuente y no a lo compilado.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Si, me parece que soluciona el problema, así que cerraría este PR a favor de #1111, no encuentro una variable que me de un path completo. @aroquega @fjsevilla-dev @humitos
Gracias!
Actualmente se redirecciona el código a los .po, pero no se redirecciona
a los .rst de .overrides/
Se agrega un if para saber si sourcename es .rst o .po