Multiple aliases for LANGUAGE strings

Moderator: GZDoom Developers

Post Reply
User avatar
Player701
 
 
Posts: 1640
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Multiple aliases for LANGUAGE strings

Post by Player701 »

NB: This only concerns the plain-text LANGUAGE format and not the CSV format.

Sometimes it so happens that multiple strings defined in a mod's LANGUAGE lump have the same content. For example, suppose we want to replace all menu quit messages with a single new message. Currently, we'd have to do it like this:

Code: Select all

QUITMSG1 = "My new message";
QUITMSG2 = "My new message";
...
QUITMSG14 = "My new message";
...
IMO, this duplication shouldn't really be necessary. What if it were possible to do this instead:

Code: Select all

QUITMSG1 =
QUITMSG2 =
QUITMSG3 =
...
QUITMSG14 = "My new message";
Eh?

I'm sure this can be implemented relatively easily. I'd be willing to code it myself and provide a PR unless the developers don't approve of this suggestion for some reason.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49073
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Multiple aliases for LANGUAGE strings

Post by Graf Zahl »

It is already implemented. I needed this feature for Raze. If you prefix a string with "$$" it is treated as a reference to another one in the table. What you propose here does not make much sense. It is not the normal case that you define a long list of identical texts.

(If you want to replace the quit messages, instead of hacking LANGUAGE, change the definition in MAPINFO.)
User avatar
Player701
 
 
Posts: 1640
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: Multiple aliases for LANGUAGE strings

Post by Player701 »

Graf Zahl wrote:It is already implemented. I needed this feature for Raze.
Oh, great! Thank you very much for letting me know.
Graf Zahl wrote:What you propose here does not make much sense. It is not the normal case that you define a long list of identical texts.

(If you want to replace the quit messages, instead of hacking LANGUAGE, change the definition in MAPINFO.)
That was just an example. There is an actual use case, it's legitimate but more complicated. My project has code that pulls strings from LANGUAGE based on CVar names to build help screens. Most of them contain a lot of text, and there are a few cases where the texts are the same. Maintaining this hasn't been easy because sometimes it can be difficult to remember where the duplicates are (everything is grouped by CVar name), getting rid of them would improve the situation.
Graf Zahl wrote:If you prefix a string with "$$" it is treated as a reference to another one in the table.
I think that's going to be sufficient. Then I suppose this should be closed as "already in"?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49073
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Multiple aliases for LANGUAGE strings

Post by Graf Zahl »

Yes.

I implemented it because for Duke Nukem I needed handling for the World Tour variant which uses different content in its scripted text definition but I didn't want to duplicate all that content in the translation sheet. The result looks like this:
[default]
// this is for redirecting World Tour's strings to language.csv
"#AuotAiming" = "$$AUTO AIMING";
"#ShowMapOff" = "$$SHOW MAP: OFF";
"#Activated" = "$$ACTIVATED";
"#PortableMedkit" = "$$PORTABLE MEDKIT";
"#Locked" = "$$LOCKED";
"#GivingEverything" = "$$GIVING EVERYTHING!";
"#Boots" = "$$BOOTS";
"#Wasted" = "$$WASTED!";
"#Unlocked" = "$$UNLOCKED";
"#ASecretPlace" = "$$A SECRET PLACE!";
"#Squish" = "$$SQUISH!";
"#AllDoorsUnlocked" = "$$ALL DOORS UNLOCKED";
"#UsedSteroids" = "$$USED STEROIDS";
"#UseToRestart" = "$$PRESS SPACE TO RESTART LEVEL";
"#AmmoForDevastator" = "$$AMMO FOR DEVASTATOR";
"#Deactivated" = "$$DEACTIVATED";
"#SwitchOperatedOnly" = "$$SWITCH OPERATED ONLY!";
"#GodModeOn" = "$$GOD MODE: ON";
"#GodModeOff" = "$$GOD MODE: OFF";
"#AtomicHealth" = "$$ATOMIC HEALTH!";
"#CrosshairOn" = "$$CROSSHAIR: ON";
"#CrosshairOff" = "$$CROSSHAIR: OFF";
"#Cheater" = "$$YOU'RE TOO GOOD TO BE CHEATING!";
"#MessagesOn" = "$$MESSAGES: ON";
"#MessagesOff" = "$$MESSAGES: OFF";
"#TypeTheCheatCode" = "$$TYPE THE CHEAT CODE:";
"#DetailLow" = "$$DETAIL: LOW";
User avatar
Player701
 
 
Posts: 1640
Joined: Wed May 13, 2009 3:15 am
Graphics Processor: nVidia with Vulkan support
Contact:

Re: Multiple aliases for LANGUAGE strings

Post by Player701 »

I've updated the corresponding wiki article with the information about this feature, in case other people are going to look for it.
Gez
 
 
Posts: 17835
Joined: Fri Jul 06, 2007 3:22 pm

Re: Multiple aliases for LANGUAGE strings

Post by Gez »

Graf Zahl wrote:Yes.

I implemented it because for Duke Nukem I needed handling for the World Tour variant which uses different content in its scripted text definition but I didn't want to duplicate all that content in the translation sheet. The result looks like this:
[default]
// this is for redirecting World Tour's strings to language.csv
"#AuotAiming" = "$$AUTO AIMING";
They called it "AuotAiming" in World Tour?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49073
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Multiple aliases for LANGUAGE strings

Post by Graf Zahl »

Yes, they misspelled their label.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”