From: Jacek S. <arn...@gm...> - 2008-01-23 20:13:57
|
> Could do with a 'plural' macro for > MATCHED_FILES used in QueueManager.cpp:982 > any suggestions ? (using dngettext maybe ?) added > However these ones, there i couldn't see a way to distinguish them > between a Singualar or a Plural, so i translated 'as is' > KICK_USER, // 'Kick user(s)' > REDIRECT_USER, // 'Redirect user(s)' > e.g. Before > addUserCommand(UserCommand::TYPE_RAW_ONCE,UserCommand::CONTEXT_CHAT > | UserCommand::CONTEXT_SEARCH,UserCommand::FLAG_NOSAVE, > STRING(KICK_USER), kickstr, 'op'); > After > addUserCommand(UserCommand::TYPE_RAW_ONCE,UserCommand::CONTEXT_CHAT > | UserCommand::CONTEXT_SEARCH,UserCommand::FLAG_NOSAVE, _('Kick > user(s)'), kickstr, 'op'); That's fine (singular or plural is unknown when the strings are added so...) > In Socket.cpp i changed this > char tmp[64]; > snprintf(tmp, sizeof(tmp), CSTRING(UNKNOWN_ERROR), aError); > msg = tmp; > to > msg = str(F_('Unknown error: 0x%1%') % aError); > where > UNKNOWN_ERROR, // 'Unknown error: 0x%x' > > Is that alright ? i was concerned maybe the 0x part was wrong / wouldn't > work way i done it. It won't work. It should be 0x%1$x or something like that to display the error in hex... > In SettingsManager.cpp i left this one for now (there is a similar one > for Uploads as well), > > setDefault(LOG_FORMAT_POST_DOWNLOAD, '%Y-%m-%d %H:%M: %[target]' + > STRING(DOWNLOADED_FROM) + '%[userNI] (%[userCID]), %[fileSI] > (%[fileSIchunk]), %[speed], %[time], %[fileTR]'); > > should a F_ be used, and all the contents put in it ? (the % stuff > already in it, might play havoc with boost::format ?), or just _ the > string ? make it just the STRING for now... > > I was also thinking maybe a non-gettext way to access boost format would > be nice to replace the snprintf 's ? Most remaining snprintf's I see are for simple conversions - boost would take longer to compile and create slower code so I'd leave it as is... /J |