← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~alocritani/widelands/make_terrains_strings_translatable into lp:widelands

 

Angelo Locritani has proposed merging lp:~alocritani/widelands/make_terrains_strings_translatable into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~alocritani/widelands/make_terrains_strings_translatable/+merge/86908

Add a "name" field to terrainconf file in order to make the terrain name translatable
-- 
https://code.launchpad.net/~alocritani/widelands/make_terrains_strings_translatable/+merge/86908
Your team Widelands Developers is requested to review the proposed merge of lp:~alocritani/widelands/make_terrains_strings_translatable into lp:widelands.
=== modified file 'src/editor/tools/editor_info_tool.cc'
--- src/editor/tools/editor_info_tool.cc	2011-11-30 21:38:37 +0000
+++ src/editor/tools/editor_info_tool.cc	2011-12-26 15:15:27 +0000
@@ -82,7 +82,7 @@
 		Widelands::Terrain_Descr const & ter = world.terrain_descr
 			(center.triangle.t == Widelands::TCoords<>::D ?
 			 tf.terrain_d() : tf.terrain_r());
-		buf += ter.name();
+		buf += ter.descname();
 		snprintf
 			(buf1, sizeof(buf1), _("\n Texture Number: %i\n"), ter.get_texture());
 		buf += buf1;

=== modified file 'src/editor/ui_menus/editor_tool_set_terrain_options_menu.cc'
--- src/editor/ui_menus/editor_tool_set_terrain_options_menu.cc	2011-11-30 21:38:37 +0000
+++ src/editor/ui_menus/editor_tool_set_terrain_options_menu.cc	2011-12-26 15:15:27 +0000
@@ -178,7 +178,7 @@
 	for (Widelands::Terrain_Index i = 0; j; ++i)
 		if (m_tool.is_enabled(i)) {
 			buf += " ";
-			buf += world.get_ter(i).name();
+			buf += world.get_ter(i).descname();
 			--j;
 		}
 	m_cur_selection.set_text(buf);
@@ -228,7 +228,7 @@
 		for (Widelands::Terrain_Index i = 0; j; ++i)
 			if (m_tool.is_enabled(i)) {
 				buf += " ";
-				buf += world.get_ter(i).name();
+				buf += world.get_ter(i).descname();
 				--j;
 			}
 

=== modified file 'src/logic/world.cc'
--- src/logic/world.cc	2011-11-30 21:38:37 +0000
+++ src/logic/world.cc	2011-12-26 15:15:27 +0000
@@ -820,6 +820,7 @@
 	 Descr_Maintainer<Resource_Descr> * const resources)
 :
 m_name              (s->get_name()),
+m_descname          (s->get_string("name", s->get_name())),
 m_picnametempl      (0),
 m_frametime         (FRAME_LENGTH),
 m_valid_resources   (0),

=== modified file 'src/logic/world.h'
--- src/logic/world.h	2011-11-30 21:38:37 +0000
+++ src/logic/world.h	2011-12-26 15:15:27 +0000
@@ -88,6 +88,7 @@
 	uint32_t         get_texture() const throw () {return m_texture;}
 	uint8_t        get_is     () const throw () {return m_is;}
 	const std::string & name() const throw () {return m_name;}
+	const std::string & descname() const throw () {return m_descname;}
 	int32_t resource_value(const Resource_Index resource) const throw () {
 		return
 			resource == get_default_resources() or is_resource_valid(resource) ?
@@ -115,6 +116,7 @@
 
 private:
 	const std::string m_name;
+	const std::string m_descname;
 	char  * m_picnametempl;
 	uint32_t    m_frametime;
 	uint8_t   m_is;
@@ -124,6 +126,7 @@
 	int8_t            m_default_resources;
 	int32_t           m_default_amount;
 	uint32_t          m_texture; //  renderer's texture
+
 };
 
 struct MapGenInfo;

=== modified file 'worlds/blackland/terrainconf'
--- worlds/blackland/terrainconf	2011-08-10 13:51:32 +0000
+++ worlds/blackland/terrainconf	2011-12-26 15:15:27 +0000
@@ -1,62 +1,78 @@
 ##### Order does matter here, since this file should stay compatible with S2
 
 [ashes]
+name=_"Ashes"
 def_resources=water 5
 is=green
 
 [mountain1]
+name=_"Mountain1"
 resources=coal, iron, gold, granit 
 is=mountain
 
 [lava-stone1]
+name=_"Lava stone1"
 is=acid
 
 [lava-stone2]
+name=_"Lava stone2"
 is=acid
 
 [strand]
+name=_"Beach"
 is=dry
 
 [water]
+name=_"Water"
 def_resources=fish 4
 is=water
 fps=14
 
 [hardground1]
+name=_"Hardground1"
 def_resources=water 10
 is=green
 
 [hardground2]
+name=_"Hardground2"
 def_resources=water 10
 is=green
 
 [hardground3]
+name=_"Hardground3"
 def_resources=water 10
 is=green
 
 [mountain2]
+name=_"Mountain2"
 resources=coal, iron, gold, granit
 is=mountain
 
 [mountain3]
+name=_"Mountain3"
 resources=coal, iron, gold, granit
 is=mountain
 
 [mountain4]
+name=_"Mountain4"
 resources=coal, iron, gold, granit
 is=mountain
 
 [ashes2]
+name=_"Ashes2"
 def_resources=water 4
 is=green
 
 [hardground4]
+name=_"Hardground4"
 def_resources=water 10
 is=green
 
 [lava]
+name=_"Lava"
 is=acid
 
 [hardlava]
+name=_"Hard lava"
 is=green
 

=== modified file 'worlds/desert/terrainconf'
--- worlds/desert/terrainconf	2009-03-18 18:21:27 +0000
+++ worlds/desert/terrainconf	2011-12-26 15:15:27 +0000
@@ -2,52 +2,66 @@
 ##### Most of them are from greenland. I just changed few colors, brightness and contrasts.
 
 [desert1]
+name=_"Desert1"
 is=dry
 
 [desert2]
+name=_"Desert2"
 is=dry
 
 [desert3]
+name=_"Desert3"
 is=dry
 
 [desert4]
+name=_"Desert4"
 def_resources=water 2
 is=green
 
 [drysoil]
+name=_"Dry soil"
 def_resources=water 4
 is=green
 
 [beach]
+name=_"Beach"
 is=dry
 
 [steppe]
+name=_"Steppe"
 def_resources=water 5
 is=green
 
 [meadow]
+name=_"Meadow"
 def_resources=water 10
 is=green
 
 [mountainmeadow]
+name=_"Mountain meadow"
 is=green
 
 [highmountainmeadow]
+name=_"High mountain meadow"
 is=green
 
 [mountain1]
+name=_"Mountain1"
 resources=coal, iron, gold, granit
 is=mountain
 
 [mountain2]
+name=_"Mountain2"
 resources=coal, iron, gold, granit
 is=mountain
 
 [mountain3]
+name=_"Mountain3"
 resources=coal, iron, gold, granit
 is=mountain
 
 [mountain4]
+name=_"Mountain4"
 resources=coal, iron, gold, granit
 is=mountain
 
@@ -55,9 +69,11 @@
 ##### Here are few imported textures of greenland
 
 [wasser]
+name=_"Water"
 def_resources=fish 4
 is=water
 fps=5
 
 [lava]
+name=_"Lava"
 is=acid

=== modified file 'worlds/greenland/terrainconf'
--- worlds/greenland/terrainconf	2011-12-18 21:11:30 +0000
+++ worlds/greenland/terrainconf	2011-12-26 15:15:27 +0000
@@ -1,64 +1,80 @@
 ##### Order does matter here, since this file should stay compatible with S2
 
 [steppe]
+name=_"Steppe"
 def_resources=water 5
 is=green
 
 [berg1]
+name=_"Mountain1"
 resources=coal, iron, gold, granit
 is=mountain
 
 [schnee]
+name=_"Snow"
 is=dead
 
 [sumpf]
+name=_"Swamp"
 def_resources=water 20
 is=unpassable
 fps=14
 
 [strand]
+name=_"Beach"
 is=dry
 
 [wasser]
+name=_"Water"
 def_resources=fish 4
 is=water
 fps=14
 
 [wiese1]
+name=_"Meadow1"
 def_resources=water 10
 is=green
 
 [wiese2]
+name=_"Meadow2"
 def_resources=water 10
 is=green
 
 [wiese3]
+name=_"Meadow3"
 def_resources=water 10
 is=green
 
 [berg2]
+name=_"Mountain2"
 resources=coal, iron, gold, granit
 is=mountain
 
 [berg3]
+name=_"Mountain3"
 resources=coal, iron, gold, granit
 is=mountain
 
 [berg4]
+name=_"Mountain4"
 resources=coal, iron, gold, granit
 is=mountain
 
 [steppe_kahl]
+name=_"Barren steppe"
 def_resources=water 4
 is=green
 
 [wiese4]
+name=_"Meadow4"
 def_resources=water 10
 is=green
 
 [lava]
+name=_"Lava"
 is=acid
 
 [bergwiese]
+name=_"Mountain meadow"
 is=green
 

=== modified file 'worlds/winterland/terrainconf'
--- worlds/winterland/terrainconf	2011-08-09 20:27:20 +0000
+++ worlds/winterland/terrainconf	2011-12-26 15:15:27 +0000
@@ -1,64 +1,80 @@
 ##### Order does matter here, since this file should stay compatible with S2
 
 [tundra]
+name=_"Tundra"
 def_resources=water 5
 is=green
 
 [mountain1]
+name=_"Mountain1"
 resources=coal, iron, gold, granit
 is=mountain
 
 [ice_flows]
+name=_"Ice flows"
 is=water
 fps=5
 
 [ice_flows2]
+name=_"Ice flows2"
 is=water
 fps=5
 
 [ice]
+name=_"Ice"
 is=dry
 #### of course ice is not dry, but this disallows the users, to build on snow. only flags are allowed. ;-)
 
 [water]
+name=_"Water"
 def_resources=fish 4
 is=water
 fps=8
 
 [tundra_taiga]
+name=_"Tundra taiga"
 def_resources=water 10
 is=green
 
 [tundra2]
+name=_"Tundra2"
 def_resources=water 10
 is=green
 
 [tundra3]
+name=_"Tundra3"
 def_resources=water 10
 is=green
 
 [mountain2]
+name=_"Mountain2"
 resources=coal, iron, gold, granit
 is=mountain
 
 [mountain3]
+name=_"Mountain3"
 resources=coal, iron, gold, granit
 is=mountain
 
 [mountain4]
+name=_"Mountain4"
 resources=coal, iron, gold, granit
 is=mountain
 
 [strand]
+name=_"Beach"
 is=dry
 
 [taiga]
+name=_"Taiga"
 def_resources=water 10
 is=green
 
 [lava]
+name=_"Lava"
 is=acid
 
 [snow]
+name=_"Snow"
 def_resources=water 30
 is=green