Opened 8 years ago

Last modified 5 years ago

#3665 new defect

GuiInterface-notifications are not translated

Reported by: elexis Owned by:
Priority: Should Have Milestone: Backlog
Component: Internationalization & Localization Keywords:
Cc: Patch:

Description (last modified by elexis)

There are many local chat notifications which are not translated, for example:

cmpGuiInterface.PushNotification({ "type": "chat", "players": [input.player], "message": "This building only has " + techs.length + " technologies." });

A correct example would be:

	cmpGUIInterface.PushNotification({
		"players": [1,2,3,4,5,6,7,8], 
		"message": markForTranslation("The first wave will start in 15 minutes!"),
		"translateMessage": true
	});

See also wiki:Internationalization#InternationalizingJavaScriptSimulationFiles

Change History (8)

comment:1 by leper, 8 years ago

In 17614:

Translate some notification messages. Refs #3665.

comment:2 by leper, 8 years ago

All remaining untranslated notifications are in Cheat.js and Commands.js. I'm not sure if we should keep the notifications in the former (some do not really add anything IMO). For the ones in Commands.js it would be nice to only push one notification in some of the commands instead of multiple. We should also (for notifyUnloadFailure and notifyBackToWorkFailure) improve the message and use proper plural forms where needed.

comment:3 by elexis, 8 years ago

In 17796:

Translate some untranslated strings, refs #3665.
Add a chat message if the control-all units cheat was used, refs #2676.

in reply to:  2 comment:4 by elexis, 8 years ago

For pluralforms, translateObjectKeys will need plural-translation support :-/

comment:5 by elexis, 8 years ago

Component: UI & SimulationI18n & L10n

comment:6 by elexis, 7 years ago

Description: modified (diff)

Another problematic GUI interface notification translation can be found in SubtractResourcesOrNotify of Player.js that hardcodes a string for 4 different resource types, while it should use getLocalizedResourceAmounts (as of r19757).

comment:7 by elexis, 7 years ago

Equally, it would be preferable if chatHelper.js would be able to pass resource codes and just use the GUI translation functions for concatenating resources and allow us to not have to pass english resource strings in the simulation, refs Phab:D625

comment:8 by Adrián Chaves, 5 years ago

Should include a fix for:

  1. https://www.transifex.com/wildfire-games/0ad/translate/#gl/$/79262094?q=issue%3Aopen:

‘Unable to ungarrison unit(s)’ should use plural translation.

  1. https://www.transifex.com/wildfire-games/0ad/translate/#gl/$/79262095?q=issue%3Aopen

‘Some unit(s) can't go back to work’ should use plural translation.

Or, if these issues are out of the scope of the current issue, a separate issue for these should be created once the current issue is fixed, since the issues reported at Trasifex would depend on the current issue being fixed first.

Last edited 5 years ago by Adrián Chaves (previous) (diff)
Note: See TracTickets for help on using tickets.