hovel / pybbm

Django forum solution. Tested, documented, shipped with example project.
BSD 2-Clause "Simplified" License
225 stars 151 forks source link

Template and translations homogenization #255

Closed DylannCordel closed 7 years ago

DylannCordel commented 7 years ago
lampslave commented 7 years ago

trans tag uses a double quote (language strings)

I think this is not a good idea. Usage of different types of quotes makes template more readable. Example.

include ":" and variables inside translations

Keep it simple ;)

DylannCordel commented 7 years ago

Okay, I'll commit to add {% trans ':' %}.

I'm not sure to understand your first comment. In this PR, we use different quotes to make templates more readable (it's easier to identify what are translated strings and what are path or arg strings). Furthermore, we need sometime to use "quote" inside translations, so I think it's simpler to always use double quote to avoid quote escape. eg: {% trans "it's simpler" %}.
If you prefer we use only simple quote, it's okay for me, I'll push another commit. My point was there was no consistency between pybbm templates (sometimes single quotes, sometimes double quotes, in the same template: exemple) What do you recommend exactly ?

lampslave commented 7 years ago

Sequences like " " " " " " make me unhappy... <p title="{% trans "title text" %}"> and <p title="{% trans "press \"yes\" to continue" %}"> for example.

I recommend to do as django developers or, if they use different styles, use double quotes in templates only for html attribues.

DylannCordel commented 7 years ago

Ok, thx for your feedback. I'll commit that.

lampslave commented 7 years ago

It's my personal opinion, I don't force you to do this. If you will find trans with double quotes in built-in templates of django, I'll accept this PR as is :)

DylannCordel commented 7 years ago

No problem @lampslave, with your examples and django coding style, you are right and you have convinced me :). It's commited.

lampslave commented 7 years ago

Thank you!