Protected hyphens?

Discuss and coordinate development of mainline and user-made content translations.

Moderator: Forum Moderators

Post Reply
User avatar
GunChleoc
Translator
Posts: 497
Joined: September 28th, 2012, 7:35 am
Contact:

Protected hyphens?

Post by GunChleoc »

Is it possible to have protected hyphens in po files? If so, how do they work?

For example, I have this string on the game screen:
Lean sinn oirbh fad air falbh bho ar dachaighean is dh’fhàg sinn gun dìon iad. Nise, càite an lorg sinn an t-
eòlach
ud aig a bheil sàr-fhiosrachadh mun choille a deas?
But it should look like this:
Lean sinn oirbh fad air falbh bho ar dachaighean is dh’fhàg sinn gun dìon iad. Nise, càite an lorg sinn an
t-eòlach ud aig a bheil sàr-fhiosrachadh mun choille a deas?
It's not the end of the world, but it would make the text more legible.
JaMiT
Developer
Posts: 511
Joined: January 22nd, 2012, 12:38 am

Re: Protected hyphens?

Post by JaMiT »

The usual term is "non-breaking hyphen" (in case you want to search for the term), and Unicode provides one at U+2011 (‑). If that does not work, it is probably a bug.
User avatar
GunChleoc
Translator
Posts: 497
Joined: September 28th, 2012, 7:35 am
Contact:

Re: Protected hyphens?

Post by GunChleoc »

Thanks, this explains why I didn't get any useful search results!

I still don't know how to get these parsed though, Wesnoth simply displays the codes instead if the character. I tested U+2011 ‑ \u2011 and pasting a non-breaking hyphen from Word. A google search gives me a lot of programmer's info about Unicode, but nothing on how to enter a unicode character in a PO file. :augh:
User avatar
Espreon
Developer
Posts: 630
Joined: June 9th, 2007, 4:08 am

Re: Protected hyphens?

Post by Espreon »

GunChleoc wrote: I still don't know how to get these parsed though, Wesnoth simply displays the codes instead if the character. I tested U+2011 ‑ \u2011 and pasting a non-breaking hyphen from Word. A google search gives me a lot of programmer's info about Unicode, but nothing on how to enter a unicode character in a PO file. :augh:
Where does the string you’re translating appear in-game? “‑” does work, but only in GUI2 elements (like the campaign selection menu, dialogue bands, story screens, ...). I don’t think GUI1 elements can make use of things like escape sequences and entities unless Pango was enabled for them (the sidebar and its tooltips are the only ones that come to mind), which is not the case for most of them.
User avatar
GunChleoc
Translator
Posts: 497
Joined: September 28th, 2012, 7:35 am
Contact:

Re: Protected hyphens?

Post by GunChleoc »

Thanks, that worked for the story screen and campaing dialogue, as well as the caimpaign description! :D

It does not work in campaign titles, scenario objectives or in the help files. Campaign titles don't have line breaks anyway, but it would be a good thing to have in the help files if possible, and maybe the scenario objectives as well (they sometimes contain multi-line hints).
User avatar
Espreon
Developer
Posts: 630
Joined: June 9th, 2007, 4:08 am

Re: Protected hyphens?

Post by Espreon »

GunChleoc wrote: It does not work in campaign titles, scenario objectives or in the help files. Campaign titles don't have line breaks anyway, but it would be a good thing to have in the help files if possible, and maybe the scenario objectives as well (they sometimes contain multi-line hints).
Converting them to GUI2 will take a lot of work, and I’m not sure what needs to be done to GUI1 elements to get them to use Pango. For now, you can just use the character (‑) directly and just make note where they’re used.
User avatar
GunChleoc
Translator
Posts: 497
Joined: September 28th, 2012, 7:35 am
Contact:

Re: Protected hyphens?

Post by GunChleoc »

Will do.

If it's a lot of work, it makes sense that reprogramming itsn't high on the list.
Post Reply