Hyphenation with internationalized skins

42 views
Skip to first unread message

michael.k...@gmx.at

unread,
Mar 6, 2023, 4:34:17 AM3/6/23
to weewx-user
How to handle manual Hyphenation? 

When I insert a soft hypen to a string like this:

[Texts]
#without hypen
    "Short in English" = "Suchalongwordwhichbreaksboxboundaries"
#with hypen
    "Short in English" = "Suchalong­wordwhich­breaksbox­boundaries"

...it works, as long as only used in HTML.

with 
[Labels]
    [[Generic]]
        rain = Nieder­schlag


I get into minor trouble, because the entity is not escaped when rendering Images:
2023-03-06 10_23_52-Greenshot Editor.png
How can I solve this without specifying it two times? I refer to the Label both, in HTML and the image, but need to let the browser hyphenate it und certain circumstances in an adaptive layout. 

Or, is specifying it two times the way to go, since these are distinct elements, and they are just the same string?

Tom Keffer

unread,
Mar 6, 2023, 7:42:59 AM3/6/23
to weewx...@googlegroups.com
I wish I had a better idea, but I think your solution is as good as anything I can come up with. 

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/0ebd7944-6b62-4afa-b210-93f70e8f0cdcn%40googlegroups.com.

michael.k...@gmx.at

unread,
Mar 6, 2023, 9:38:49 AM3/6/23
to weewx-user
My latest idea is a mixed strategy:

I know the critical parts of the layout, where hyphenation is essential for responsiveness and at the same time, weewx labels are used. For these parts of the layout I use hyphens: auto; in the css. This may lead to a hyphenation which may look a little bit unusual (I wouldn't hyphenate "encyclopedia" as "encyclope-dia" or "en-cyclopedia", rather "encyclo-pedia", although it's correct in any way), but doesn't break the layout and it is just for the critical parts. For the rest, I use  hyphens: manual; and propose using ­ entities only for [Text] values.

In the end, it is the users decision, anyway.

Tom Keffer

unread,
Mar 6, 2023, 10:57:39 AM3/6/23
to weewx...@googlegroups.com
Sometimes that's the best one can come up with: make something functional, but always with the ability to customize.

Reply all
Reply to author
Forward
0 new messages