"Branch" was pluralized as "branchs".
Fixes T9225.
Differential D13944
Fix wrong plural of an `arc land` message jbeta on Aug 20 2015, 2:46 AM. Authored by Tags None Referenced Files
Details
"Branch" was pluralized as "branchs". Fixes T9225.
Diff Detail
Event TimelineComment Actions try something like $branchTypePlural = magic ? 'bookmarks' : 'branches'; pht( 'Separate these revisions onto different %s, or use.....', $branchTypePlural); to avoid the lengthy text duplication. Comment Actions Overall, probably yes, but that's the way we do it everywhere (Like in line 501 on the left side here - $branchType is used as a value, and would need some magic to be translated anyway). pht( 'Separate these revisions onto different %s', pht_token(plural, $branchType)); And all the backend work for it. Comment Actions All the existing code doing that kind of stuff in arc is wrong (and not translatable); this change is using the correct method. This article got updated a while ago to include some examples like this: https://secure.phabricator.com/book/phabcontrib/article/internationalization/ Comment Actions Hmm... still, @avivey should be right in that $this->branchType makes the complete message not translatable, no? Comment Actions Yeah. This is better than the old code was (this fragment is now properly translatable, and reads correctly in English), but the entire block of text should be present in each branch of the switch to be completely correct and fully translatable. I'll mention two other very minor technical things for the sake of completeness: First, this particular splitting of fragments requires translators to retain a newline at the end of the first translation, which may be hard if we eventually have non-technical translators or more human-friendly translation UIs. If a block of text should legitimately be split up, any paragraph formatting is probably better left untranslated. For example, it's probably better to do this: $sections = array(); $sections[] = pht("First Section"); $sections[] = pht("Second Section"); $sections = implode("\n", $sections); ...than this: $sections = array(); $sections[] = pht("First Section\n"); $sections[] = pht("Second Section"); $sections = implode('', $sections); This gets rid of the need for translators to handle the "\n" properly, and is often a little easier for to work with code-wise too (e.g., you can reorder sections more easily). This will be made irrelevant by making the entire block translatable as a unit. Second, indentation of the body of the switch() isn't consistent with the rest of the codebase, should be like this: switch(...) { case ...: } ...instead of: switch(...) { case ...: } (Indent stuff is a little tricky to handle statically, so automatic lint detection of indent rules lags behind other static checks.) Comment Actions Got it. In general, the rest of the code relies on an untranslated $this->branchType. I suppose that should be solved in a more general diff. Comment Actions Yeah, it's fine to just fix this case without fixing every other case. This looks good to me, thanks! |