------------------------------------------------------------ revno: 402 committer: Steven Sheehy <[email protected]> branch nick: linuxdcpp-i18n timestamp: Fri 2010-11-12 02:07:06 -0600 message: Plural translations modified: SConstruct glade/mainwindow.glade linux/IntlUtil.hh linux/finishedtransfers.cc linux/hashdialog.cc linux/hub.cc linux/mainwindow.cc linux/privatemessage.cc linux/publichubs.cc linux/search.cc linux/search.hh
-- lp:~linuxdcpp-team/linuxdcpp/linuxdcpp-i18n https://code.launchpad.net/~linuxdcpp-team/linuxdcpp/linuxdcpp-i18n Your team LinuxDC++ Team is subscribed to branch lp:~linuxdcpp-team/linuxdcpp/linuxdcpp-i18n. To unsubscribe from this branch go to https://code.launchpad.net/~linuxdcpp-team/linuxdcpp/linuxdcpp-i18n/+edit-subscription
=== modified file 'SConstruct' --- SConstruct 2010-11-10 03:45:41 +0000 +++ SConstruct 2010-11-12 08:07:06 +0000 @@ -149,9 +149,10 @@ pot_args = ['xgettext', '--default-domain=$PACKAGE', '--package-name=$PACKAGE', '--msgid-bugs-address=https://translations.launchpad.net/linuxdcpp', '--copyright-holder=LinuxDC++ Team', '--add-comments=TRANSLATORS', - '--keyword=_', '--keyword=N_', '--keyword=C_', '--keyword=F_', '--keyword=P_', - '--from-code=UTF-8', '--foreign-user', '--no-wrap', '--boost', '--sort-output', - '--language=$LANGUAGE', '--output=$TARGET', '$SOURCES'] + '--keyword=_', '--keyword=N_', '--keyword=C_:1c,2', '--keyword=F_', + '--keyword=P_:1,2', '--from-code=UTF-8', '--foreign-user', + '--no-wrap', '--boost', '--sort-output', '--language=$LANGUAGE', + '--output=$TARGET', '$SOURCES'] pot_build = Builder(action = Action([pot_args], 'Extracting messages to $TARGET from $SOURCES')) env.Append(BUILDERS = {'PotBuild' : pot_build}) === modified file 'glade/mainwindow.glade' --- glade/mainwindow.glade 2010-10-14 03:51:12 +0000 +++ glade/mainwindow.glade 2010-11-12 08:07:06 +0000 @@ -968,7 +968,7 @@ </child> </widget> <widget class="GtkDialog" id="ucLineDialog"> - <property name="title" translatable="yes">Enter line for user command</property> + <property name="title" translatable="yes">User Command Argument</property> <property name="default_width">300</property> <property name="destroy_with_parent">True</property> <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property> === modified file 'linux/IntlUtil.hh' --- linux/IntlUtil.hh 2010-11-10 07:07:40 +0000 +++ linux/IntlUtil.hh 2010-11-12 08:07:06 +0000 @@ -40,7 +40,6 @@ #define F_(text, params) (message_format(_(text)) params).str() #define P_(text, text_plural, params, n) (message_format(g_dngettext(NULL, text, text_plural, n)) params).str() -#define FC_(context, text, params) (message_format(C_(context, text)) params).str() #endif /* LINUXDCPP_INTL_UTIL_HH */ === modified file 'linux/finishedtransfers.cc' --- linux/finishedtransfers.cc 2010-11-10 07:07:40 +0000 +++ linux/finishedtransfers.cc 2010-11-12 08:07:06 +0000 @@ -156,7 +156,8 @@ void FinishedTransfers::updateStatus_gui() { - string status = P_("%1% file", "%1% files", % totalFiles, totalFiles); + // TRANSLATORS: Displays the total number of files in the status bar. + string status = P_("%1% File", "%1% Files", % totalFiles, totalFiles); string size = Util::formatBytes(totalBytes); string speed = Util::formatBytes((totalTime > 0) ? totalBytes * ((int64_t)1000) / totalTime : 0) + "/s"; === modified file 'linux/hashdialog.cc' --- linux/hashdialog.cc 2010-11-10 07:07:40 +0000 +++ linux/hashdialog.cc 2010-11-12 08:07:06 +0000 @@ -55,10 +55,14 @@ double diff = tick - startTime; if (diff < 1000 || files == 0 || bytes == 0) { - // TRANSLATORS: Hashing speed and bytes left + // TRANSLATORS: Hashing speed and bytes left to hash const gchar *speed = F_("%1%/s, %2% left", % Util::formatBytes(0) % Util::formatBytes(bytes)).c_str(); + + // TRANSLATORS: Time left to hash the remaining files. + const gchar *time = F_("%1% left", % Util::formatSeconds(0)).c_str(); + gtk_label_set_text(GTK_LABEL(getWidget("labelSpeed")), speed); - gtk_label_set_text(GTK_LABEL(getWidget("labelTime")), C_("Time", "-:--:-- left")); + gtk_label_set_text(GTK_LABEL(getWidget("labelTime")), time); gtk_progress_bar_set_text(GTK_PROGRESS_BAR(getWidget("progressbar")), "0%"); gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(getWidget("progressbar")), 0.0); } @@ -71,12 +75,12 @@ if (speedStat == 0) { - gtk_label_set_text(GTK_LABEL(getWidget("labelTime")), C_("Time", "-:--:-- left")); + gtk_label_set_text(GTK_LABEL(getWidget("labelTime")), F_("%1% left", % Util::formatSeconds(0)).c_str()); } else { double ss = (double)bytes / speedStat; - const gchar *time = FC_("Time", "%1% left", % Util::formatSeconds((int64_t)ss)).c_str(); + const gchar *time = F_("%1% left", % Util::formatSeconds((int64_t)ss)).c_str(); gtk_label_set_text(GTK_LABEL(getWidget("labelTime")), time); } } === modified file 'linux/hub.cc' --- linux/hub.cc 2010-11-10 07:07:40 +0000 +++ linux/hub.cc 2010-11-12 08:07:06 +0000 @@ -203,6 +203,7 @@ void Hub::updateStats_gui() { + // TRANSLATORS: Count of users appearing in the status bar. setStatus_gui("statusUsers", P_("%1% User", "%1% Users", % userMap.size(), userMap.size())); setStatus_gui("statusShared", Util::formatBytes(totalShared)); } @@ -994,7 +995,7 @@ } else { - hub->addStatusMessage_gui(F_("Unknown command '%1%': type /help for a list of available commands", % text)); + hub->addStatusMessage_gui(F_("Unknown command '%1%': Type /help for a list of available commands", % text)); } } @@ -1566,7 +1567,7 @@ WulforManager::get()->dispatchGuiFunc(f0); typedef Func1<Hub, string> F1; - F1 *f1 = new F1(this, &Hub::addStatusMessage_gui, F_("Connect failed: ", % reason)); + F1 *f1 = new F1(this, &Hub::addStatusMessage_gui, F_("Connect failed: %1%", % reason)); WulforManager::get()->dispatchGuiFunc(f1); } === modified file 'linux/mainwindow.cc' --- linux/mainwindow.cc 2010-10-11 06:05:22 +0000 +++ linux/mainwindow.cc 2010-11-12 08:07:06 +0000 @@ -160,7 +160,8 @@ gtk_widget_destroy(dummy); emptyStatusWidth = req.width; - setMainStatus_gui(_("Welcome to ") + string(g_get_application_name())); + // TRANSLATORS: Shown in status bar on startup. + setMainStatus_gui(F_("Welcome to %1%", % g_get_application_name())); loadIcons_gui(); showTransfersPane_gui(); @@ -465,9 +466,9 @@ void MainWindow::updateStatusIconTooltip_gui(string download, string upload) { - ostringstream toolTip; - toolTip << g_get_application_name() << endl << _("Download: ") << download << endl << _("Upload: ") << upload; - gtk_status_icon_set_tooltip(statusIcon, toolTip.str().c_str()); + // TRANSLATORS: Notify icon (systray) tooltip + string tooltip = F_("%1%\nDownload: %2%\nUpload: %3%", % g_get_application_name() % download % upload); + gtk_status_icon_set_tooltip(statusIcon, tooltip.c_str()); } void MainWindow::showNotification_gui(string title, string body) @@ -728,12 +729,10 @@ bool MainWindow::getUserCommandLines_gui(const string &command, StringMap &ucParams) { string name; - string label; string line; StringMap done; string::size_type i = 0; string::size_type j = 0; - string text = string("<b>") + _("Enter value for ") + "\'"; while ((i = command.find("%[line:", i)) != string::npos) { @@ -746,7 +745,9 @@ if (done.find(name) == done.end()) { line.clear(); - label = text + name + "\'</b>"; + + // TRANSLATORS: Appears in a dialog prompt when a user command requires arguments. + string label = F_("Enter a value for '%1%'", % name); gtk_label_set_label(GTK_LABEL(getWidget("ucLabel")), label.c_str()); gtk_entry_set_text(GTK_ENTRY(getWidget("ucLineEntry")), ""); @@ -1249,7 +1250,7 @@ catch (const Exception &e) { string primaryText = _("Unable to open TCP/TLS port"); - string secondaryText = _("File transfers will not work correctly until you change settings or turn off any application that might be using the TCP/TLS port."); + string secondaryText = _("File transfers will not work correctly until the connection settings are adjusted or any application using the port is closed."); typedef Func2<MainWindow, string, string> F2; F2* func = new F2(this, &MainWindow::showMessageDialog_gui, primaryText, secondaryText); WulforManager::get()->dispatchGuiFunc(func); @@ -1263,7 +1264,7 @@ catch (const Exception &e) { string primaryText = _("Unable to open UDP port"); - string secondaryText = _("Searching will not work correctly until you change settings or turn off any application that might be using the UDP port."); + string secondaryText = _("Searching will not work correctly until the connection settings are adjusted or any application using the port is closed."); typedef Func2<MainWindow, string, string> F2; F2* func = new F2(this, &MainWindow::showMessageDialog_gui, primaryText, secondaryText); WulforManager::get()->dispatchGuiFunc(func); === modified file 'linux/privatemessage.cc' --- linux/privatemessage.cc 2010-10-11 06:05:22 +0000 +++ linux/privatemessage.cc 2010-11-12 08:07:06 +0000 @@ -331,7 +331,7 @@ Util::setAway(TRUE); Util::setManualAway(TRUE); Util::setAwayMessage(param); - pm->addStatusMessage_gui(_("Away mode on: ") + Util::getAwayMessage()); + pm->addStatusMessage_gui(F_("Away mode on: %1%", % Util::getAwayMessage())); } } else if (command == _("back")) @@ -376,7 +376,7 @@ } else { - pm->addStatusMessage_gui(_("Unknown command ") + text + _(": type /help for a list of available commands")); + pm->addStatusMessage_gui(F_("Unknown command '%1%': Type /help for a list of available commands", % text)); } } else @@ -644,7 +644,7 @@ if (BOOLSETTING(SHOW_JOINS) || (BOOLSETTING(FAV_SHOW_JOINS) && FavoriteManager::getInstance()->isFavoriteUser(user))) { - statusMessage = nicks + _(" has quit"); + statusMessage = F_("%1% has quit", % nicks); } typedef Func4<PrivateMessage, string, string, bool, string> F4; === modified file 'linux/publichubs.cc' --- linux/publichubs.cc 2010-10-22 04:05:48 +0000 +++ linux/publichubs.cc 2010-11-12 08:07:06 +0000 @@ -169,8 +169,8 @@ gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(hubStore), sortColumn, sortType); - setStatus_gui("statusHubs", _("Hubs: ") + Util::toString(numHubs)); - setStatus_gui("statusUsers", _("Users: ") + Util::toString(numUsers)); + setStatus_gui("statusHubs", P_("%1% Hub", "%1% Hubs", % numHubs, numHubs)); + setStatus_gui("statusUsers", P_("%1% User", "%1% Users", % numUsers, numUsers)); } void PublicHubs::setStatus_gui(string statusBar, string text) @@ -427,7 +427,7 @@ void PublicHubs::on(FavoriteManagerListener::DownloadStarting, const string &file) throw() { - string msg = _("Download starting: ") + file; + string msg = F_("Download starting: %1%", % file); typedef Func2<PublicHubs, string, string> Func; Func *func = new Func(this, &PublicHubs::setStatus_gui, "statusMain", msg); WulforManager::get()->dispatchGuiFunc(func); @@ -435,7 +435,7 @@ void PublicHubs::on(FavoriteManagerListener::DownloadFailed, const string &file) throw() { - string msg = _("Download failed: ") + file; + string msg = F_("Download failed: %1%", % file); typedef Func2<PublicHubs, string, string> Func; Func *func = new Func(this, &PublicHubs::setStatus_gui, "statusMain", msg); WulforManager::get()->dispatchGuiFunc(func); @@ -443,7 +443,7 @@ void PublicHubs::on(FavoriteManagerListener::DownloadFinished, const string &file) throw() { - string msg = _("Download finished: ") + file; + string msg = F_("Download finished: %1%", % file); typedef Func2<PublicHubs, string, string> Func; Func *f2 = new Func(this, &PublicHubs::setStatus_gui, "statusMain", msg); WulforManager::get()->dispatchGuiFunc(f2); === modified file 'linux/search.cc' --- linux/search.cc 2010-10-22 04:05:48 +0000 +++ linux/search.cc 2010-11-12 08:07:06 +0000 @@ -38,6 +38,10 @@ Search::Search(): BookEntry(Entry::SEARCH, _("Search"), "search.glade", generateID()), + droppedResult(0), + searchHits(0), + isHash(false), + onlyFree(BOOLSETTING(SEARCH_ONLY_FREE_SLOTS)), previousGrouping(NOGROUPING) { // Initialize the search entries combo box @@ -53,7 +57,6 @@ gtk_dialog_set_alternative_button_order(GTK_DIALOG(getWidget("dirChooserDialog")), GTK_RESPONSE_OK, GTK_RESPONSE_CANCEL, -1); // Initialize check button options. - onlyFree = BOOLSETTING(SEARCH_ONLY_FREE_SLOTS); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(getWidget("checkbuttonSlots")), onlyFree); gtk_widget_set_sensitive(GTK_WIDGET(getWidget("checkbuttonSlots")), FALSE); gtk_widget_set_sensitive(GTK_WIDGET(getWidget("checkbuttonShared")), FALSE); @@ -161,6 +164,7 @@ void Search::show() { initHubs_gui(); + updateStats_gui(); ClientManager::getInstance()->addListener(this); SearchManager::getInstance()->addListener(this); } @@ -383,6 +387,15 @@ gtk_statusbar_push(GTK_STATUSBAR(getWidget(statusBar)), 0, text.c_str()); } +void Search::updateStats_gui() +{ + // TRANSLATORS: Appears in the status bar when a valid search result is received. + setStatus_gui("statusbar2", P_("%1% Result", "%1% Results", % searchHits, searchHits)); + + // TRANSLATORS: Appears in the status bar when a search result is ignored/dropped. + setStatus_gui("statusbar3", F_("%1% Dropped", % droppedResult)); +} + void Search::search_gui() { StringList clients; @@ -459,9 +472,8 @@ droppedResult = 0; searchHits = 0; - setStatus_gui("statusbar1", _("Searching for ") + text + " ..."); - setStatus_gui("statusbar2", _("0 items")); - setStatus_gui("statusbar3", _("0 filtered")); + setStatus_gui("statusbar1", F_("Searching for %1%...", % text)); + updateStats_gui(); setLabel_gui(text); if (SearchManager::getInstance()->okToSearch()) @@ -474,10 +486,8 @@ else { int32_t waitFor = SearchManager::getInstance()->timeToSearch(); - string line = _("Searching too soon, retry in ") + Util::toString(waitFor) + " s"; + string line = F_("Searching too soon, retry in %1% s", % waitFor); setStatus_gui("statusbar1", line); - setStatus_gui("statusbar2", ""); - setStatus_gui("statusbar3", ""); } } @@ -556,7 +566,7 @@ updateParentRow_gui(&parent, &iter); ++searchHits; - setStatus_gui("statusbar2", Util::toString(searchHits) + _(" items")); + updateStats_gui(); if (BOOLSETTING(BOLD_SEARCH)) setBold_gui(); @@ -595,7 +605,7 @@ gint children = gtk_tree_model_iter_n_children(GTK_TREE_MODEL(resultStore), parent); dcassert(children != 0); - string users = Util::toString(children) + _(" user(s)"); + string users = P_("%1% User", "%1% Users", % children, children); gtk_tree_store_set(resultStore, parent, resultView.col("User"), users.c_str(), -1); if (child == NULL) @@ -1726,14 +1736,12 @@ if (searchlist.empty() || result == NULL) return; - typedef Func2<Search, string, string> F2; - if (isHash) { if (result->getType() != SearchResult::TYPE_FILE || TTHValue(searchlist[0]) != result->getTTH()) { ++droppedResult; - F2 *func = new F2(this, &Search::setStatus_gui, "statusbar3", Util::toString(droppedResult) + _(" filtered")); + Func0<Search> *func = new Func0<Search>(this, &Search::updateStats_gui); WulforManager::get()->dispatchGuiFunc(func); return; } @@ -1746,7 +1754,7 @@ (*i->begin() == '-' && i->size() != 1 && Util::findSubString(result->getFile(), i->substr(1)) != (string::size_type)-1)) { ++droppedResult; - F2 *func = new F2(this, &Search::setStatus_gui, "statusbar3", Util::toString(droppedResult) + _(" dropped")); + Func0<Search> *func = new Func0<Search>(this, &Search::updateStats_gui); WulforManager::get()->dispatchGuiFunc(func); return; } === modified file 'linux/search.hh' --- linux/search.hh 2010-10-11 06:05:22 +0000 +++ linux/search.hh 2010-11-12 08:07:06 +0000 @@ -67,6 +67,7 @@ void removeHub_gui(std::string url); void popupMenu_gui(); void setStatus_gui(std::string statusBar, std::string text); + void updateStats_gui(); void search_gui(); void addResult_gui(const dcpp::SearchResultPtr result); GtkTreeIter createParentRow_gui(GtkTreeIter *child, const std::string &groupStr, gint position = -1);
_______________________________________________ Mailing list: https://launchpad.net/~linuxdcpp-team Post to : [email protected] Unsubscribe : https://launchpad.net/~linuxdcpp-team More help : https://help.launchpad.net/ListHelp

