Closes T8050, Format Calendar list objects
Details
- Reviewers
epriestley chad - Group Reviewers
Blessed Reviewers - Maniphest Tasks
- T8050: Calendar List formatting
- Commits
- Restricted Diffusion Commit
rPe291b906419a: Format Calendar list objects
Open Calendar list, check that new formatting is true to mocks.
Diff Detail
- Repository
- rP Phabricator
- Branch
- calendarlistformatting
- Lint
Lint Passed - Unit
Tests Passed - Build Status
Buildable 6817 Build 6839: [Placeholder Plan] Wait for 30 Seconds
Event Timeline
src/applications/calendar/query/PhabricatorCalendarEventSearchEngine.php | ||
---|---|---|
339–340 | These may layout better, especially on mobile, as addIcon('none', $value) instead of addByline(...). | |
src/applications/calendar/storage/PhabricatorCalendarEvent.php | ||
376 | This method is mostly not translatable, because it hard-codes English plural rules. In English, there are forms for "one" (like 'day') and "any number other than one" (like 'days'). Languages like Czech have different plural forms for "one", "several" and "many". For example, in Czech, you say "1 den", then "2 dny", "3 dny", "4 dny", but then "5 dnů", "6 dnů", etc (or so says Google Translate). It isn't possible to translate a string like "days" into Czech, because the translator needs to know if there are 3 or 5 of them to hcoose between "dny" and "dnů". It may also be difficult or impossible to translate fragments of sentences correctly. In some languages, in "1 day, 3 hours", the correct word for "day" might depend on how many hours there are. A more general (although less similar) example of this is Spanish, where articles depend on nouns. If we asked a Spanish-speaking user to translate the fragment "I am the" and then separately translate "pen." and "pencil.", they would not be able to produce a correct translation which would satisfy a native speaker, because the word for "the" depends on the noun: the first fragment might be "Yo soy la" or "Yo so el" depending on the rest of the sentence. (In other languages, the most natural way to translate this sentence might read more like "The pen, it is me." if transliterated, but a translator can't reorder the words properly to produce this most-satisfying-translation if they're handed fragments.) Broadly, this means translatable strings should let the translation engine handle plural rules and should usually be complete sentences, or at least as complete as possible. Here, I'd expect there to be 5 pht() calls total, for these strings:
You can then edit the PhabricatorUSEnglishTranslation to translate %s day(s) into "1 day" and "2 days", but using the strings as the basis for the translation allows a future Czech translator to specify all the variants their language needs. You could also use phutil_format_relative_time() to produce an uglier, also-untranslatable version of this string, but we'll have to go fix that method eventually anyway. |