Make translation more flexible

Also in this commit, unrelated updates to the building panel (so git sees the markup "just" move in my next commit)
This commit is contained in:
Lirusaito
2012-09-29 16:59:17 -04:00
parent f311852e9b
commit 1f7ed035d3
9 changed files with 110 additions and 80 deletions

View File

@@ -86,11 +86,18 @@ LLPrefsAscentChat::LLPrefsAscentChat()
LLUUID itemid = (LLUUID)gSavedPerAccountSettings.getString("AscentInstantMessageResponseItemData");
LLViewerInventoryItem* item = gInventory.getItem(itemid);
if (item) childSetValue("im_give_disp_rect_txt", LLTrans::getString("CurrentlySetTo") + LLTrans::getString(":") + " " +item->getName());
else if (itemid.isNull()) childSetValue("im_give_disp_rect_txt", LLTrans::getString("CurrentlyNotSet"));
else childSetValue("im_give_disp_rect_txt", LLTrans::getString("CurrentlySetTo") + " " + LLTrans::getString("AnItemNotOnThisAccount"));
if (item)
{
LLStringUtil::format_map_t args;
args["[ITEM]"] = item->getName();
childSetValue("im_give_disp_rect_txt", LLTrans::getString("CurrentlySetTo", args));
}
else if (itemid.isNull())
childSetValue("im_give_disp_rect_txt", LLTrans::getString("CurrentlyNotSet"));
else
childSetValue("im_give_disp_rect_txt", LLTrans::getString("CurrentlySetToAnItemNotOnThisAccount"));
}
else childSetValue("im_give_disp_rect_txt", LLTrans::getString("NotLoggedIn"));
else childSetValue("im_give_disp_rect_txt", LLTrans::getString("NotLoggedIn"));
childSetCommitCallback("im_response", onCommitAutoResponse, this);
@@ -242,7 +249,9 @@ void LLPrefsAscentChat::onCommitAutoResponse(LLUICtrl* ctrl, void* user_data)
void LLPrefsAscentChat::SinguIMResponseItemDrop(LLViewerInventoryItem* item)
{
gSavedPerAccountSettings.setString("AscentInstantMessageResponseItemData", item->getUUID().asString());
sInst->childSetValue("im_give_disp_rect_txt", LLTrans::getString("CurrentlySetTo") + LLTrans::getString(":") + " " +item->getName());
LLStringUtil::format_map_t args;
args["[ITEM]"] = item->getName();
sInst->childSetValue("im_give_disp_rect_txt", LLTrans::getString("CurrentlySetTo", args));
}
//static

View File

@@ -103,11 +103,18 @@ LLPrefsAscentSys::LLPrefsAscentSys()
LLUUID itemid = (LLUUID)gSavedPerAccountSettings.getString("EmeraldBuildPrefs_Item");
LLViewerInventoryItem* item = gInventory.getItem(itemid);
if (item) childSetValue("build_item_add_disp_rect_txt", LLTrans::getString("CurrentlySetTo") + LLTrans::getString(":") + "\n" +item->getName());
else if (itemid.isNull()) childSetValue("build_item_add_disp_rect_txt", LLTrans::getString("CurrentlyNotSet"));
else childSetValue("build_item_add_disp_rect_txt", LLTrans::getString("CurrentlySetTo") + "\n" + LLTrans::getString("AnItemNotOnThisAccount"));
if (item)
{
LLStringUtil::format_map_t args;
args["[ITEM]"] = item->getName();
childSetValue("build_item_add_disp_rect_txt", LLTrans::getString("CurrentlySetTo", args));
}
else if (itemid.isNull())
childSetValue("build_item_add_disp_rect_txt", LLTrans::getString("CurrentlyNotSet"));
else
childSetValue("build_item_add_disp_rect_txt", LLTrans::getString("CurrentlySetToAnItemNotOnThisAccount"));
}
else childSetValue("build_item_add_disp_rect_txt", LLTrans::getString("NotLoggedIn"));
else childSetValue("build_item_add_disp_rect_txt", LLTrans::getString("NotLoggedIn"));
refreshValues();
refresh();
@@ -245,10 +252,13 @@ void LLPrefsAscentSys::onCommitTexturePicker(LLUICtrl* ctrl, void* userdata)
if(image_ctrl) gSavedSettings.setString("EmeraldBuildPrefs_Texture", image_ctrl->getImageAssetID().asString());
}
//static
void LLPrefsAscentSys::SinguBuildItemDrop(LLViewerInventoryItem* item)
{
gSavedPerAccountSettings.setString("EmeraldBuildPrefs_Item", item->getUUID().asString());
sInst->childSetValue("build_item_add_disp_rect_txt", LLTrans::getString("CurrentlySetTo") + LLTrans::getString(":") + "\n" + item->getName());
LLStringUtil::format_map_t args;
args["[ITEM]"] = item->getName();
sInst->childSetValue("build_item_add_disp_rect_txt", LLTrans::getString("CurrentlySetTo", args));
}
void LLPrefsAscentSys::refreshValues()

View File

@@ -331,7 +331,9 @@ BOOL LLFloaterAO::postBuild()
LLViewerInventoryItem* itemimport = gInventory.getItem(itemidimport);
if(itemimport)
{
childSetValue("ao_nc_text", LLTrans::getString("CurrentlySetTo") + LLTrans::getString(":") + " " +itemimport->getName());
LLStringUtil::format_map_t args;
args["[ITEM]"] = itemimport->getName();
childSetValue("ao_nc_text", LLTrans::getString("CurrentlySetTo", args));
}
else if(itemidimport.isNull())
{
@@ -339,7 +341,7 @@ BOOL LLFloaterAO::postBuild()
}
else
{
childSetValue("ao_nc_text", LLTrans::getString("CurrentlySetTo") + " " + LLTrans::getString("AnItemNotOnThisAccount"));
childSetValue("ao_nc_text", LLTrans::getString("CurrentlySetToAnItemNotOnThisAccount"));
}
}
else
@@ -795,7 +797,9 @@ void LLFloaterAO::setCurrentStandId(const LLUUID& id)
void LLFloaterAO::AOItemDrop(LLViewerInventoryItem* item)
{
gSavedPerAccountSettings.setString("AOConfigNotecardID", item->getUUID().asString());
sInstance->childSetValue("ao_nc_text", LLTrans::getString("CurrentlySetTo") + LLTrans::getString(":") + " " +item->getName());
LLStringUtil::format_map_t args;
args["[ITEM]"] = item->getName();
sInstance->childSetValue("ao_nc_text", LLTrans::getString("CurrentlySetTo", args));
}
LLUUID LLFloaterAO::GetAnimID(const LLUUID& id)

View File

@@ -84,54 +84,55 @@ typedef enum e_radar_alert_type
void chat_avatar_status(std::string name, LLUUID key, ERadarAlertType type, bool entering)
{
static LLCachedControl<bool> radar_chat_alerts(gSavedSettings, "RadarChatAlerts");
if (!radar_chat_alerts) return;
static LLCachedControl<bool> radar_alert_sim(gSavedSettings, "RadarAlertSim");
static LLCachedControl<bool> radar_alert_draw(gSavedSettings, "RadarAlertDraw");
static LLCachedControl<bool> radar_alert_shout_range(gSavedSettings, "RadarAlertShoutRange");
static LLCachedControl<bool> radar_alert_chat_range(gSavedSettings, "RadarAlertChatRange");
static LLCachedControl<bool> radar_chat_keys(gSavedSettings, "RadarChatKeys");
if (radar_chat_alerts)
LLFloaterAvatarList* self = LLFloaterAvatarList::getInstance();
LLStringUtil::format_map_t args;
switch(type)
{
case ALERT_TYPE_SIM:
if (radar_alert_sim)
{
args["[RANGE]"] = self->getString("the_sim");
}
break;
case ALERT_TYPE_DRAW:
if (radar_alert_draw)
{
args["[RANGE]"] = self->getString("draw_distance");
}
break;
case ALERT_TYPE_SHOUTRANGE:
if (radar_alert_shout_range)
{
args["[RANGE]"] = self->getString("shout_range");
}
break;
case ALERT_TYPE_CHATRANGE:
if (radar_alert_chat_range)
{
args["[RANGE]"] = self->getString("chat_range");
}
break;
}
if (args.find("[RANGE]") != args.end())
{
args["[NAME]"] = name;
args["[ACTION]"] = self->getString(entering ? "has_entered" : "has_left");
LLChat chat;
LLFloaterAvatarList* self = LLFloaterAvatarList::getInstance();
std::string message = name + " " + self->getString(entering ? "has_entered" : "has_left") + " ";
switch(type)
{
case ALERT_TYPE_SIM:
if (radar_alert_sim)
{
chat.mText = message + self->getString("the_sim") + ".";
}
break;
case ALERT_TYPE_DRAW:
if (radar_alert_draw)
{
chat.mText = message + self->getString("draw_distance") + ".";
}
break;
case ALERT_TYPE_SHOUTRANGE:
if (radar_alert_shout_range)
{
chat.mText = message + self->getString("shout_range") + ".";
}
break;
case ALERT_TYPE_CHATRANGE:
if (radar_alert_chat_range)
{
chat.mText = message + self->getString("chat_range") + ".";
}
break;
}
if (chat.mText != "")
{
chat.mFromName = name;
chat.mURL = llformat("secondlife:///app/agent/%s/about",key.asString().c_str());
chat.mSourceType = CHAT_SOURCE_SYSTEM;
LLFloaterChat::addChat(chat);
}
chat.mText = self->getString("template", args);
chat.mFromName = name;
chat.mURL = llformat("secondlife:///app/agent/%s/about",key.asString().c_str());
chat.mSourceType = CHAT_SOURCE_SYSTEM;
LLFloaterChat::addChat(chat);
}
}

View File

@@ -338,8 +338,11 @@
/>
</panel>
</tab_container>
<string name="template">[NAME] [ACTION] [RANGE].</string>
<!-- [ACTION] -->
<string name="has_entered">has entered</string>
<string name="has_left">has left</string>
<!-- [RANGE] -->
<string name="the_sim">the sim</string>
<string name="draw_distance">draw distance</string>
<string name="shout_range">shout range</string>

View File

@@ -92,23 +92,17 @@
</panel>
<panel border="true" left="1" bottom="-408" height="408" width="500" label="Building" name="Building">
<text bottom_delta="-19" follows="top" height="10" left_delta="30" name="text_box6">Pivot Point</text>
<text bottom_delta="-19" follows="top" height="10" left_delta="30" name="text_box6" halign="center" width="80">Pivot Point</text>
<spinner bottom_delta="-20" decimal_digits="5" follows="top" height="16" increment="0.05" label="X pos" label_width="40" left="10" max_val="256" min_val="-256" name="X pos" width="120" control_name="AscentBuildPrefs_PivotX"/>
<spinner bottom_delta="-20" decimal_digits="5" follows="top" height="16" increment="0.05" label="Y pos" label_width="40" max_val="256" min_val="-256" name="Y pos" width="120" control_name="AscentBuildPrefs_PivotY"/>
<spinner bottom_delta="-20" decimal_digits="5" follows="top" height="16" increment="0.05" label="Z pos" label_width="40" max_val="256" min_val="-256" name="Z pos" width="120" control_name="AscentBuildPrefs_PivotZ"/>
<check_box bottom_delta="-20" follows="top" label="Values are percent" left_delta="-5" tool_tip="Default settings are Percentages and every axis set at 50" name="EmPivotPercToggle" control_name="AscentBuildPrefs_PivotIsPercent"/>
<check_box bottom_delta="60" follows="top" label="Enable highlighting of selected prims" left_delta="140" name="EmBuildPrefsRenderHighlight_toggle" control_name="RenderHighlightSelections"/>
<check_box bottom_delta="-20" follows="top" initial_value="false" label="Show axis arrow on root prim position" tool_tip="Default behaviour is to show the axis on the center of mass of a linkset. If enabled, the axis will be shown on the root prim of the linkset instead." name="EmBuildPrefsActualRoot_toggle" control_name="AscentBuildPrefs_ActualRoot"/>
<view_border bevel_style="none" border_thickness="1" bottom="-180" follows="top" height="70" left="5" name="NextOwnerBorder" width="130"/>
<text bottom_delta="60" follows="top" height="10" left_delta="10" name="text_box7">Allow next owner:</text>
<check_box follows="top" height="16" initial_value="false" label="Copy permissions" tool_tip="Next owner can make copies of creations" name="next_owner_copy" control_name="NextOwnerCopy"/>
<check_box follows="top" height="16" initial_value="false" label="Modify permission" tool_tip="Next owner can edit creations" name="next_owner_modify" control_name="NextOwnerModify"/>
<check_box follows="top" height="16" initial_value="true" label="Transfer permission" tool_tip="Next owner can give(or sell) creations" name="next_owner_transfer" control_name="NextOwnerTransfer"/>
<texture_picker allow_no_texture="false" bottom="-190" can_apply_immediately="true" default_image_name="Default" follows="top" height="80" label=" Texture" left="155" name="texture control" control_name="EmeraldBuildPrefs_Texture" tool_tip="Click to choose a texture" width="64"/>
<check_box bottom="-131" left_delta="75" follows="top" height="16" label="Phantom" name="EmPhantomToggle" control_name="EmeraldBuildPrefs_Phantom"/>
<check_box follows="top" height="16" label="Physical" name="EmPhysicalToggle" control_name="EmeraldBuildPrefs_Physical"/>
<check_box follows="top" height="16" label="Temporary" name="EmTemporaryToggle" control_name="EmeraldBuildPrefs_Temporary"/>
<combo_box bottom="-190" left_delta="6" follows="top" height="18" name="material" width="64" control_name="BuildPrefs_Material">
<text bottom="-19" left="170" name="Dimensions" halign="center" width="70">Dimensions</text>
<spinner bottom_delta="-20" left_delta="-20" decimal_digits="5" follows="left|top" height="16" increment="0.0005" label="X size" label_width="40" max_val="10" min_val="0.0001" name="X size" width="110" control_name="BuildPrefs_Xsize"/>
<spinner bottom_delta="-20" decimal_digits="5" follows="left|top" height="16" increment="0.0005" label="Y size" label_width="40" max_val="10" min_val="0.0001" name="Y size" width="110" control_name="BuildPrefs_Ysize"/>
<spinner bottom_delta="-20" decimal_digits="5" follows="left|top" height="16" increment="0.0005" label="Z size" label_width="40" max_val="10" min_val="0.0001" name="Z size" width="110" control_name="BuildPrefs_Zsize"/>
<text bottom_delta="-15" left_delta="-6" follows="top" name="Material">Material:</text>
<combo_box bottom_delta="-5" left_delta="48" follows="top" height="18" name="material" width="74" control_name="BuildPrefs_Material">
<combo_item name="Stone" value="Stone">Stone</combo_item>
<combo_item name="Metal" value="Metal">Metal</combo_item>
<combo_item name="Glass" value="Glass">Glass</combo_item>
@@ -117,8 +111,16 @@
<combo_item name="Plastic" value="Plastic">Plastic</combo_item>
<combo_item name="Rubber" value="Rubber">Rubber</combo_item>
</combo_box>
<color_swatch border_color="0.45098, 0.517647, 0.607843, 1" bottom="-190" can_apply_immediately="true" color="1, 1, 1, 1" follows="top" height="80" label=" Color" left_delta="76" name="colorswatch" tool_tip="Click to open Color Picker" width="64" control_name="EmeraldBuildPrefs_Color"/>
<spinner bottom_delta="60" decimal_digits="0" follows="top" height="16" increment="1" label="Alpha" label_width="45" left_delta="70" max_val="100" min_val="0" name="alpha" width="97" control_name="EmeraldBuildPrefs_Alpha"/>
<text bottom="-19" left_delta="85" name="text_box7" halign="center" width="115">Next Owner Perms</text>
<check_box follows="top" height="16" initial_value="false" label="Copy permission" tool_tip="Next owner can make copies of creations" name="next_owner_copy" control_name="NextOwnerCopy"/>
<check_box follows="top" height="16" initial_value="false" label="Modify permission" tool_tip="Next owner can edit creations" name="next_owner_modify" control_name="NextOwnerModify"/>
<check_box follows="top" height="16" initial_value="true" label="Transfer permission" tool_tip="Next owner can give(or sell) creations" name="next_owner_transfer" control_name="NextOwnerTransfer"/>
<check_box bottom="-131" left="5" follows="top" height="16" label="Phantom" name="EmPhantomToggle" control_name="EmeraldBuildPrefs_Phantom"/>
<check_box follows="top" height="16" label="Physical" name="EmPhysicalToggle" control_name="EmeraldBuildPrefs_Physical"/>
<check_box follows="top" height="16" label="Temporary" name="EmTemporaryToggle" control_name="EmeraldBuildPrefs_Temporary"/>
<texture_picker allow_no_texture="false" bottom="-190" can_apply_immediately="true" default_image_name="Default" follows="top" height="80" label=" Texture" left="108" name="texture control" control_name="EmeraldBuildPrefs_Texture" tool_tip="Click to choose a texture" width="64"/>
<color_swatch border_color="0.45098, 0.517647, 0.607843, 1" bottom="-190" can_apply_immediately="true" color="1, 1, 1, 1" follows="top" height="80" label=" Color" left_delta="88" name="colorswatch" tool_tip="Click to open Color Picker" width="64" control_name="EmeraldBuildPrefs_Color"/>
<spinner bottom_delta="60" decimal_digits="0" follows="top" height="16" increment="1" label="Alpha" label_width="45" left_delta="88" max_val="100" min_val="0" name="alpha" width="97" control_name="EmeraldBuildPrefs_Alpha"/>
<spinner bottom_delta="-20" decimal_digits="2" follows="top" height="16" increment="0.05" label="Glow" label_width="45" max_val="1" min_val="0" name="glow" width="97" control_name="EmeraldBuildPrefs_Glow"/>
<check_box follows="top" height="16" label="Full Bright" name="EmFBToggle" control_name="EmeraldBuildPrefs_FullBright"/>
<text name="shine" follows="top">Shine</text>
@@ -129,14 +131,12 @@
<combo_item name="High" value="High">High</combo_item>
</combo_box>
<check_box name="EmeraldBuildPrefsEmbedItem" left="5" bottom_delta="-15" follows="top" initial_value="false" label="Put an item into new objects" control_name="EmeraldBuildPrefs_EmbedItem"/>
<view_border blevel_style="in" bottom_delta="-20" left="25" follows="top" height="16" name="build_item_drop_target_rect" width="140"/>
<text bottom_delta="0" left_delta="8" follows="top" height="16" name="Give inventory">Drop inventory item here</text>
<view_border blevel_style="in" bottom_delta="-35" left_delta="-8" follows="top" height="35" name="build_item_add_disp_rect" width="140"/>
<text bottom_delta="15" left_delta="0" follows="top" height="16" name="build_item_add_disp_rect_txt" halign="center" width="138">Currently set to:
ITEM</text>
<spinner bottom="369" left="370" decimal_digits="5" follows="left|top" height="16" increment="0.0005" label="X size" label_width="40" max_val="10" min_val="0.0001" name="X size" width="110" control_name="BuildPrefs_Xsize"/>
<spinner bottom_delta="-20" decimal_digits="5" follows="left|top" height="16" increment="0.0005" label="Y size" label_width="40" max_val="10" min_val="0.0001" name="Y size" width="110" control_name="BuildPrefs_Ysize"/>
<spinner bottom_delta="-20" decimal_digits="5" follows="left|top" height="16" increment="0.0005" label="Z size" label_width="40" max_val="10" min_val="0.0001" name="Z size" width="110" control_name="BuildPrefs_Zsize"/>
<view_border blevel_style="in" bottom_delta="-35" left="25" follows="top" height="35" name="build_item_drop_target_rect" width="194"/>
<text bottom_delta="16" left_delta="8" follows="top" height="16" name="Give inventory" halign="center" width="178">Drop inventory item here</text>
<view_border blevel_style="in" bottom_delta="-16" left_delta="-8" follows="top" height="16" name="build_item_add_disp_rect" width="194"/>
<text bottom_delta="0" left_delta="0" follows="top" height="16" name="build_item_add_disp_rect_txt" halign="center" width="192">Currently set to: ITEM</text>
<check_box bottom_delta="17" follows="top" left_delta="194" label="Highlight selected prims" name="EmBuildPrefsRenderHighlight_toggle" control_name="RenderHighlightSelections"/>
<check_box bottom_delta="-20" follows="top" initial_value="false" label="Axis arrow on root prim position" tool_tip="Default behaviour is to show the axis on the center of mass of a linkset. If enabled, the axis will be shown on the root prim of the linkset instead." name="EmBuildPrefsActualRoot_toggle" control_name="AscentBuildPrefs_ActualRoot"/>
</panel>
</tab_container>

View File

@@ -2817,8 +2817,8 @@ Where tag = tag string to match. Removes bot's matching the tag.
<!-- Strings needed by drop targets -->
<string name="CurrentlyNotSet">Currently not set</string>
<string name="CurrentlySetTo">Currently set to</string>
<string name="AnItemNotOnThisAccount">an item not on this account</string>
<string name="CurrentlySetTo">Currently set to: [ITEM]</string>
<string name="CurrentlySetToAnItemNotOnThisAccount">Currently set to an item not on this account</string>
<string name="NotLoggedIn">Not logged in</string>
<!-- Avatar busy/away mode -->

View File

@@ -76,8 +76,11 @@
<button name="send_keys_btn" label="Anunciar Ahora" tool_tip="Envia todas las keys al HUD ahora"/>
</panel>
</tab_container>
<string name="template">[NAME] [ACTION] [RANGE].</string>
<!-- [ACTION] -->
<string name="has_entered">ha entrado en</string>
<string name="has_left">se ha retirado de</string>
<!-- [RANGE] -->
<string name="the_sim">el sim</string>
<string name="draw_distance">la distancia de dibujo</string>
<string name="shout_range">la distancia de grito</string>

View File

@@ -1837,8 +1837,8 @@ Returns a key that is the UUID of the user seated on the prim.
<!-- Strings needed by drop targets -->
<string name="CurrentlyNotSet">No definido actualmente </string>
<string name="CurrentlySetTo">Actualmente definido a</string>
<string name="AnItemNotOnThisAccount">Un artículo no está en esta cuenta</string>
<string name="CurrentlySetTo">Actualmente definido a: [ITEM]</string>
<string name="CurrentlySetToAnItemNotOnThisAccount">Actualmente definido a un artículo no está en esta cuenta</string>
<string name="NotLoggedIn">Desconectado</string>
<!-- Avatar busy/away mode -->