Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#1079 closed defect (fixed)

Activity.content is not fully translatable

Reported by: Jessica Tallon Owned by:
Priority: major Milestone: 0.8.0
Component: programming Keywords: translations, activities, api
Cc: Parent Tickets:

Description

Currently the "object" in the Activity.content is not translatable because it uses Activity.generate_content uses model.object_type which is purposefully forced to English as it's used in the API.

This could be fixed by doing:

{
    "image": _("an image"),
    "comment": _("a comment"),
    etc...
}

This would allow it be translatable and get the correct article in English which is currently missing.

Change History (5)

comment:1 by JanKusanagi, 9 years ago

In addition to that, when the object has a displayName (as images usually have, but comments don't), that could be used instead.
This happens in Pump.io. If you update an image, and it has a title, the 'update' activity will say "JohnDoe updated Nice picture of my Holidays", instead of "an image".

Note that there's an ugly bug in Pump.io regarding this that should be avoided here: when for some reason, the object has a displayName, but it's an empty string, the activity description becomes something like "JohnDoy posted a comment in reply to." and similar.

Version 0, edited 9 years ago by JanKusanagi (next)

comment:2 by Jessica Tallon, 9 years ago

Owner: set to Jessica Tallon
Status: newin_progress

Thanks for your suggestion Jankusangi, I'll make sure to incorporate that when fixing this bug.

comment:3 by Jessica Tallon, 9 years ago

Owner: Jessica Tallon removed
Resolution: fixed
Status: in_progressclosed

This has been fixed as of 1e0c938. This will now:

1) Try to use object.displayName
2) Try to use a translated "an image", "a comment", etc. (object specific name)
3) Otherwise it'll use translated "an object"

It will skip object.displayName if it is an empty string such as "" or any number o spaces such as " ".

comment:4 by Jessica Tallon, 9 years ago

Resolution: fixed
Status: closedaccepted

I just looked back over the commit and noticed this isn't fully finished. The target as well as the object needs to be translatable and needs to have the same rules applied over it that object does.

comment:5 by Jessica Tallon, 9 years ago

Resolution: fixed
Status: acceptedclosed

This has been fixed, both the object and the target are translatable.

Note: See TracTickets for help on using tickets.