ushahidi / platform-pattern-library

Platform UI Pattern Library
http://preview.ushahidi.com/platform-pattern-library/master/
Other
39 stars 69 forks source link

Tricky translation string for post author, time and source #56

Open rjmackay opened 8 years ago

rjmackay commented 8 years ago

The pattern library creates some tricky to translate strings https://www.dropbox.com/s/qz7f0ui1v3me75f/Screenshot%202016-05-17%2016.06.11.png?dl=0

"Jess Shorland, 45 mins, via SMS" would ideally be built from a single translation string of "{Name}, {post date}, via {source}" This allows translators to reorder the phrase as appropriate for their language. However because formatting and link around the user name (and probably the avatar too) we have to either:

Could we change the format here and make theses clearly 3 separate elements? .. or maybe theres another better solution. We can work around this in the client, but the solutions are awkward.

brandonrosage commented 8 years ago

I believe I've solved for this in recent revisions to "postcards." For example, in this Timeline example, avatar, name, time, and source are all separate.

Does that address the problem, @rjmackay?

sethburtonhall commented 8 years ago

@brandonrosage each item needs to have translate applied so I believe the desired outcome would be

<a href="" class="metadata-author" translate>{name)</a>, <span translate>{post_date}</span> <span translate>{source}</span>

or maybe just one <span> like so

<a href="" class="metadata-author" translate>{Name)</a>, <span translate>{post_date} {source}</span>

@rjmackay can you chime in here?

rjmackay commented 8 years ago

We haven't solved this. Because we still have HTML wrapping the author we can't combine author into the same translation string as source + date. Its really made worse by the commas between each portion. We end up with a translation that begins with a comma like: ", {{date}}, via {{source}}"
I think in the client I just dropped the , from the text entirely.

TBH this is super minor - so we could just ignore it for now.