19 Commits

Author SHA1 Message Date
Wedge009
2ed6803aef Remove trailing white-space.
[ci skip]
2019-08-27 13:41:01 +10:00
Wedge009
e4e260709a Address comments against #3246 in order to resolve #2016.
* Remove unused notify_mode.NOTIFY_COUNT.
* Remove obsolete comment against mp_ui_alerts::items.
* Remove unused is_lobby parameter in mp_ui_alerts::game_created().
* Synchronise game_created sound in game_config.cfg with game_config.cpp.

(cherry picked from commit abaa77f7c6ca5a7b02ca9dc5b8bb52159bbcb4c9)
2019-08-27 13:41:01 +10:00
ville
169cff9ec7 Adds a preference item for a sound being played and desktop notifications in the lobby when a new game is created.
Remove unnecessary blank lines and debugging comments

- Adds a preferences entry in the multiplayer/alerts menu so sounds and desktop notifications can be toggled.

Reformat a few points for consistency

Have desktop notification show name and scenario of new game

Have desktop notification show name and scenario of new game

Update desktop notifications to use VGETTEXT for translations

(cherry picked from commit af71dbf1b1caec0ac654180cca9c037955602301)
(cherry picked from commit a2d994328669499549a614753781ba9cabcfa41d)
2019-08-27 13:41:01 +10:00
Martin Hrubý (hrubymar10)
674fda85b7 Migrate links to https if available - Fwd c18537edc0678f40a209797d72dfaba3e5e88545
(cherry-picked from commit bc4d22dc72e79c3d6a3364ac896e473afd298246)
2018-10-07 03:23:36 +00:00
Iris Morelle
1ef6c5b2c0 Replace all instances of naked vgettext() calls with VGETTEXT()
The vgettext() function, while declared in src/formula/string_utils.hpp,
actually has its implementation out-of-line in
src/formula/string_utils.cpp where GETTEXT_TEXTDOMAIN is defined to
"wesnoth-lib". Because vgettext() is implemented in terms of the _()
function (an inline wrapper around translation::dsgettext()), it passes
the textdomain defined in the file where it was implemented as a
parameter.

This means that every case of vgettext() being used in other code units
where GETTEXT_TEXTDOMAIN is not defined to "wesnoth-lib", is broken if
the string being looked upon doesn't coincidentally exist in the
wesnoth-lib textdomain.

Ages ago, to work around this limitation, an overload of vgettext() that
takes the textdomain name as a parameter was introduced (see commit
0ba3d05204abff72f7d95cf11a91536dab5aa20a). Since this form of vgettext()
is rather unwieldy to use (and in particular, the xgettext message
extraction tool mistakes the first argument for the msgid, see below), a
VGETTEXT() macro was also added that uses the GETTEXT_TEXTDOMAIN symbol
defined in the file where the call is made, and thus we get the correct
string from the correct textdomain.

Switching all cases of naked vgettext() in mainline to VGETTEXT() fixes
a myriad of situations where an interpolated string that has an extant
translation does not actually get translated in practice because of the
mismatched textdomain reference (see issue #2709 for an example with MP
game titles). I couldn't find any cases of the companion vngettext()
function (which handles plurals) being used in the wild naked, but for
future reference it also has a companion VNGETTEXT() macro to pass the
correct textdomain to its textdomain-parameter overload.

One caveat is that this commit DOES break the string freeze in one
particular case -- src/units/unit.cpp has a case where the
textdomain-parameter version of naked vgettext() was in use with
"wesnoth" as the first parameter, and xgettext misidentified this as a
translation entry for a "wesnoth" string in the file's assigned
textdomain (which is the default textdomain, wesnoth). So this will
result in the next pot-update both removing the spurious "wesnoth"
string AND adding the correct string to the relevant catalogue template
("<span color=\"$color\">$number_or_percent</span> HP").
to that textdomain.

Other than that, I believe this does not break the string freeze in any
other fashion and it shouldn't result in any regressions for i18n.

It might be worth considering in the future renaming vgettext() and
vngettext() to names that make people less likely to misidentify them as
functions they can freely call directly without regard to the textdomain
assignment issue.

(cherry-picked from commit c5b3947e4a837dc98868e3b2c3fa55668fec27a4)
2018-10-07 03:18:04 +00:00
Gregory A Lundberg
b5f76eff79
Bump copyright to 2018 2018-01-19 00:02:20 -06:00
Charles Dang
e4f03fe459 Moved all preferences source files into a single folder 2017-05-04 11:04:19 +11:00
Charles Dang
0031f9a45a Don't copy-initialize containers 2017-04-25 04:30:49 +11:00
Celtic Minstrel
b4dc11ce36 Belated 2017 copyright update 2017-03-19 10:05:38 -04:00
Celtic Minstrel
f815c2272a Pass strings by constref when possible
These instances were found by cppcheck.
Thanks matthiaskrgr for running it.
2017-03-16 17:07:04 -04:00
Charles Dang
e22c8967ee Cleaned up global.hpp includes 2016-12-17 15:21:04 +11:00
Charles Dang
a0ffdff812 Convert plain usecases of boost::assign::list_of() to initializer lists
Usecases calling to_container() or convert_to_container() were left alone.
2016-04-01 01:51:01 +11:00
Celtic Minstrel
fe0df45947 Consolidate formula and hotkey files in corresponding dirs 2016-03-20 16:15:50 -04:00
Chris Beck
ba51524f6e update copyright to year 2016
using this shell script:

find src -type f -print0 | xargs -0 sed -i "s|Copyright (C) \([[:digit:]]*\)\([ ]*\)-\([ ]*\)2015|Copyright (C) \1\2-\32016|g"
2016-01-02 23:59:31 -05:00
Ignacio R. Morelle
57ae45387a New Year copyright update 2015-01-01 19:07:35 -03:00
Chris Beck
835da049f2 create "turn_changed" preference under mp alerts 2014-10-18 19:54:29 -04:00
Chris Beck
304033e66b move the "turn changed" alert code to mp_ui_alerts namespace 2014-10-18 19:45:42 -04:00
Chris Beck
3c562f6d28 for chats, put the msg in desktop notification, not vague nonsense 2014-10-14 12:45:41 -04:00
Chris Beck
5a053a13bc rename mp_ui_sounds -> mp_ui_alerts 2014-10-12 16:19:56 -04:00