Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#1946 closed enhancement (duplicate)

Allow using a tag, such as [br], to define line breaks in GUI XML files

Reported by: Adrián Chaves Owned by:
Priority: Should Have Milestone:
Component: Core engine Keywords:
Cc: Patch:

Description

Currently, to print line breaks in text in the GUI XML files, you need to use them in the XML file itself:

<object>
[font="serif-bold-16"]Alpha XIII: Magadha![/font]

WARNING: This is an early development version of the game. Many features have not been added yet.

Get involved at: play0ad.com
</object>

I would like to be able to do this:

<object>[font="serif-bold-16"]Alpha XIII: Magadha![/font][br][br]WARNING: This is an early development version of the game. Many features have not been added yet.[br][br]Get involved at: play0ad.com</object>

Implementation requires modifying sources/gui/GUItext.h and sources/gui/GUItext.cpp, as far as I can tell.

I want this feature so that I can implement internationalization of this type of text objects in XML like this:

<object>
    <keep>[font="serif-bold-16"]</keep>
    <localize>Alpha XIII: Magadha</localize>
    <keep>[/font][br][br]</keep>
    <localize>WARNING: This is an early development version of the game. Many features have not been added yet.</localize>
    <keep>[br][br]</keep>
    <localize>Get involved at: play0ad.com</localize>
</object>

So that translators can work with that object as the following three strings:

  • Alpha XIII: Magadha
  • WARNING: This is an early development version of the game. Many features have not been added yet.
  • Get involved at: play0ad.com

Change History (5)

comment:1 by Adrián Chaves, 11 years ago

For now, I’m using \n in the XML files to do the same thing, and I use CStr.UnescapeBackslashes() to get it converted to a line break.

in reply to:  description comment:2 by zoot, 11 years ago

Replying to Gallaecio:

I want this feature so that I can implement internationalization of this type of text objects in XML like this:

<object>
    <keep>[font="serif-bold-16"]</keep>
    <localize>Alpha XIII: Magadha</localize>
    <keep>[/font][br][br]</keep>
    <localize>WARNING: This is an early development version of the game. Many features have not been added yet.</localize>
    <keep>[br][br]</keep>
    <localize>Get involved at: play0ad.com</localize>
</object>

No offense, but this seems very convoluted to me. Does any other internationalization system use such a level of complexity? What is wrong with translating the whole string at once?

comment:3 by Adrián Chaves, 11 years ago

Ok, I can do so. Still, I think [br] would be a nice addition, and one that wouldn’t require much effort to someone that has worked on that part of the code before.

comment:4 by Adrián Chaves, 11 years ago

Resolution: duplicate
Status: newclosed

This is “fixed” in the internationalization branch (#67), just using “\n” instead of “[br]”.

comment:5 by leper, 11 years ago

Milestone: Backlog
Note: See TracTickets for help on using tickets.