Skip to content

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

Closed
wants to merge 3 commits into from

Conversation

eamanu
Copy link
Contributor

@eamanu eamanu commented Oct 26, 2020

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

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
Copy link
Collaborator

@aroquega aroquega left a 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

@eamanu
Copy link
Contributor Author

eamanu commented Oct 26, 2020

@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-

@aroquega
Copy link
Collaborator

aroquega commented Oct 26, 2020

No hay problema, ni siquiera me compilaba la documentación e iba intentar, gracias @eamanu por hacerlo.

@eamanu eamanu changed the title Se agrega redirección ah codigo en ./overrides Se agrega redirección al codigo en ./overrides Oct 26, 2020
@eamanu
Copy link
Contributor Author

eamanu commented Oct 26, 2020

@aroquega No me ha funcionado.

Quieres abrir un PR Nuevo?

Copy link
Collaborator

@aroquega aroquega left a 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

@aroquega
Copy link
Collaborator

@aroquega No me ha funcionado.

Quieres abrir un PR Nuevo?

No no, mejor encargate, porque igual creo que es cambiar ese if. @eamanu

@aroquega
Copy link
Collaborator

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

@aroquega
Copy link
Collaborator

Era noma comparar con .rst.txt en el endswith, no es necesario que haga otro pr, 👍

@eamanu
Copy link
Contributor Author

eamanu commented Oct 26, 2020

No me ha funcionado, no veo que venga el soucename, de una manera que pueda diferenciarlas

@aroquega
Copy link
Collaborator

No me ha funcionado, no veo que venga el soucename, de una manera que pueda diferenciarlas

Tienes razón 😞

@aroquega
Copy link
Collaborator

@eamanu crees que page_source_suffix muestre el sufijo correcto?

@fjsevilla-dev
Copy link
Contributor

fjsevilla-dev commented Oct 27, 2020

@eamanu crees que page_source_suffix muestre el sufijo correcto?

Hace unos días estuve trasteando con esto un rato, creo recordar que page_source_suffix es .rst para todos, al igual que ocurre con soucename (.rst.txt). No he tenido tiempo de seguir probando, puede que exista una opción muy obvia, pero yo, quitando la triste versión hardcoding que obviamente si va a funcionar, no encontré una forma sencilla de diferenciar los archivos. :(

@aroquega
Copy link
Collaborator

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.

Copy link
Collaborator

@humitos humitos left a 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}}
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

Copy link
Collaborator

@humitos humitos left a 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') %}
Copy link
Collaborator

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

Copy link
Contributor Author

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

Copy link
Contributor

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" :)

Copy link
Collaborator

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.

Copy link
Contributor Author

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!

@eamanu eamanu closed this Oct 29, 2020
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

Successfully merging this pull request may close these issues.

4 participants