Conditional loading of language/locale specific css and php files
nukaga opened this issue · 2 comments
Description
In the current site design, the title is too large in Japanese and Chinese.
The center alignment is also extraordinary.
Solution
Is it possible to separate the title and body CSS in several languages?
I think a possible neat and WordPress-like solution is, for example;
- If the site setting is
ja
, the theme will additionally look for and loadja.css
on top of style.css. - If the site setting is
en_gb
, the theme will look foren_gb
, thenen
...
and so on . A conditional or auto-loading of language specific php would be nice too, because then we can dequeue the latin font, and replace with, e.g., ja font if only the site is ja.
I know that Justin Tadlock's Hybrid theme series has had this customization for a long time. I have contributed to his Stargazer theme's ja.css. Also as a bonus, this way, it makes easier for polyglot community to add contribute language specific files later its release.
https://github.com/justintadlock/stargazer
I believe in latest Hybrid core system, the relevant codes are around here:
https://themehybrid.com/docs/hybrid-core-i18n
https://github.com/justintadlock/hybrid-core/tree/master/src/Lang
Would this be feasible solution to adopt this into twentytwenty? (event better, the core?)
(of course, not adding the Hybrid-Core into twentytwenty but adopting some relevant codes)
Has been moved to trac https://core.trac.wordpress.org/ticket/48800