aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPilzAdam <pilzadam@minetest.net>2015-10-25 10:56:58 +0100
committerPilzAdam <pilzadam@minetest.net>2015-10-25 10:56:58 +0100
commit6907c3e40a16d491fd0f7b224ba30a58e0777a24 (patch)
tree613a3aa4c4e7689c11597c815b858846382407ab
parent1f76808e4fa5a198f1dbddba6fa18ea1ecb20cb6 (diff)
downloadminetest-6907c3e40a16d491fd0f7b224ba30a58e0777a24.tar.gz
minetest-6907c3e40a16d491fd0f7b224ba30a58e0777a24.tar.bz2
minetest-6907c3e40a16d491fd0f7b224ba30a58e0777a24.zip
Escape " in generated settings_translation_file.cpp
-rw-r--r--builtin/mainmenu/tab_settings.lua11
-rw-r--r--minetest.conf.example2
-rw-r--r--src/settings_translation_file.cpp20
3 files changed, 18 insertions, 15 deletions
diff --git a/builtin/mainmenu/tab_settings.lua b/builtin/mainmenu/tab_settings.lua
index 463a5e90b..d1ebb23ad 100644
--- a/builtin/mainmenu/tab_settings.lua
+++ b/builtin/mainmenu/tab_settings.lua
@@ -703,14 +703,17 @@ local function create_translation_file()
local settings = parse_config_file(true, false)
for _, entry in ipairs(settings) do
if entry.type == "category" then
- result = result .. "\tgettext(\"" .. entry.name .. "\");\n"
+ local name_escaped = entry.name:gsub("\"", "\\\"")
+ result = result .. "\tgettext(\"" .. name_escaped .. "\");\n"
else
if entry.readable_name then
- result = result .. "\tgettext(\"" .. entry.readable_name .. "\");\n"
+ local readable_name_escaped = entry.readable_name:gsub("\"", "\\\"")
+ result = result .. "\tgettext(\"" .. readable_name_escaped .. "\");\n"
end
if entry.comment ~= "" then
- local comment = entry.comment:gsub("\n", "\\n")
- result = result .. "\tgettext(\"" .. comment .. "\");\n"
+ local comment_escaped = entry.comment:gsub("\n", "\\n")
+ comment_escaped = comment_escaped:gsub("\"", "\\\"")
+ result = result .. "\tgettext(\"" .. comment_escaped .. "\");\n"
end
end
end
diff --git a/minetest.conf.example b/minetest.conf.example
index b2630c1bd..d5c161866 100644
--- a/minetest.conf.example
+++ b/minetest.conf.example
@@ -38,7 +38,7 @@
# type: bool
# noclip = false
-# Smooths camera when moving and looking arround.
+# Smooths camera when moving and looking around.
# Useful for recording videos.
# type: bool
# cinematic = false
diff --git a/src/settings_translation_file.cpp b/src/settings_translation_file.cpp
index 961c61334..bdeb1b82b 100644
--- a/src/settings_translation_file.cpp
+++ b/src/settings_translation_file.cpp
@@ -8,13 +8,13 @@ fake_function() {
gettext("Build inside player");
gettext("If enabled, you can place blocks at the position (feet + eye level) where you stand.\nThis is helpful when working with nodeboxes in small areas.");
gettext("Flying");
- gettext("Player is able to fly without being affected by gravity.\nThis requires the "fly" privilege on the server.");
+ gettext("Player is able to fly without being affected by gravity.\nThis requires the \"fly\" privilege on the server.");
gettext("Fast movement");
- gettext("Fast movement (via use key).\nThis requires the "fast" privilege on the server.");
+ gettext("Fast movement (via use key).\nThis requires the \"fast\" privilege on the server.");
gettext("Noclip");
- gettext("If enabled together with fly mode, player is able to fly through solid nodes.\nThis requires the "noclip" privilege on the server.");
+ gettext("If enabled together with fly mode, player is able to fly through solid nodes.\nThis requires the \"noclip\" privilege on the server.");
gettext("Cinematic mode");
- gettext("Smooths camera when moving and looking arround.\nUseful for recording videos.");
+ gettext("Smooths camera when moving and looking around.\nUseful for recording videos.");
gettext("Camera smoothing");
gettext("Smooths rotation of camera. 0 to disable.");
gettext("Camera smoothing in cinematic mode");
@@ -24,11 +24,11 @@ fake_function() {
gettext("Mouse sensitivity");
gettext("Mouse sensitivity multiplier.");
gettext("Key use for climbing/descending");
- gettext("If enabled, "use" key instead of "sneak" key is used for climbing down and descending.");
+ gettext("If enabled, \"use\" key instead of \"sneak\" key is used for climbing down and descending.");
gettext("Double tap jump for fly");
gettext("Double-tapping the jump key toggles fly mode.");
gettext("Always fly and fast");
- gettext("If disabled "use" key is used to fly fast if both fly and fast mode are enabled.");
+ gettext("If disabled \"use\" key is used to fly fast if both fly and fast mode are enabled.");
gettext("Rightclick repetition interval");
gettext("The time in seconds it takes between repeated right clicks when holding the right mouse button.");
gettext("Random input");
@@ -112,7 +112,7 @@ fake_function() {
gettext("Fog");
gettext("Whether to fog out the end of the visible area.");
gettext("New style water");
- gettext("Enable a bit lower water surface, so it doesn't "fill" the node completely.\nNote that this is not quite optimized and that smooth lighting on the\nwater surface doesn't work with this.");
+ gettext("Enable a bit lower water surface, so it doesn't \"fill\" the node completely.\nNote that this is not quite optimized and that smooth lighting on the\nwater surface doesn't work with this.");
gettext("Leaves style");
gettext("Leaves style:\n- Fancy: all faces visible\n- Simple: only outer faces, if defined special_tiles are used\n- Opaque: disable transparency");
gettext("Connect glass");
@@ -422,7 +422,7 @@ fake_function() {
gettext("Map generation limit");
gettext("Where the map generator stops.\nPlease note:\n- Limited to 31000 (setting above has no effect)\n- The map generator works in groups of 80x80x80 nodes (5x5x5 MapBlocks).\n- Those groups have an offset of -32, -32 nodes from the origin.\n- Only groups which are within the map_generation_limit are generated");
gettext("Mapgen flags");
- gettext("Global map generation attributes.\nFlags that are not specified in the flag string are not modified from the default.\nFlags starting with "no" are used to explicitly disable them.\n'trees' and 'flat' flags only have effect in mgv6.");
+ gettext("Global map generation attributes.\nFlags that are not specified in the flag string are not modified from the default.\nFlags starting with \"no\" are used to explicitly disable them.\n'trees' and 'flat' flags only have effect in mgv6.");
gettext("Advanced");
gettext("Chunk size");
gettext("Size of chunks to be generated at once by mapgen, stated in mapblocks (16 nodes).");
@@ -449,7 +449,7 @@ fake_function() {
gettext("Mapgen v5 cave2 noise parameters");
gettext("Mapgen v6");
gettext("Mapgen v6 flags");
- gettext("Map generation attributes specific to Mapgen V6.\nWhen snowbiomes are enabled jungles are enabled and the jungles flag is ignored.\nFlags that are not specified in the flag string are not modified from the default.\nFlags starting with "no" are used to explicitly disable them.");
+ gettext("Map generation attributes specific to Mapgen V6.\nWhen snowbiomes are enabled jungles are enabled and the jungles flag is ignored.\nFlags that are not specified in the flag string are not modified from the default.\nFlags starting with \"no\" are used to explicitly disable them.");
gettext("Mapgen v6 desert frequency");
gettext("Controls size of deserts and beaches in Mapgen V6.\nWhen snowbiomes are enabled 'mgv6_freq_desert' is ignored.");
gettext("Mapgen v6 beach frequency");
@@ -466,7 +466,7 @@ fake_function() {
gettext("Mapgen v6 apple trees noise parameters");
gettext("Mapgen v7");
gettext("Mapgen v7 flags");
- gettext("Map generation attributes specific to Mapgen V7.\n'ridges' are the rivers.\nFlags that are not specified in the flag string are not modified from the default.\nFlags starting with "no" are used to explicitly disable them.");
+ gettext("Map generation attributes specific to Mapgen V7.\n'ridges' are the rivers.\nFlags that are not specified in the flag string are not modified from the default.\nFlags starting with \"no\" are used to explicitly disable them.");
gettext("Mapgen v7 terrain base noise parameters");
gettext("Mapgen v7 terrain altitude noise parameters");
gettext("Mapgen v7 terrain persistation noise parameters");