Closed
Bug 487364
Opened 16 years ago
Closed 14 years ago
Support localized "Share This" sites
Categories
(addons.mozilla.org Graveyard :: Public Pages, enhancement, P3)
addons.mozilla.org Graveyard
Public Pages
Tracking
(Not tracked)
RESOLVED
FIXED
4.x (triaged)
People
(Reporter: clouserw, Assigned: hiro)
References
Details
Attachments
(4 files)
|
6.77 KB,
patch
|
Details | Diff | Splinter Review | |
|
4.35 KB,
patch
|
Details | Diff | Splinter Review | |
|
3.42 KB,
patch
|
Details | Diff | Splinter Review | |
|
1.14 KB,
patch
|
Details | Diff | Splinter Review |
We hardcoded 5 "share this" sites. We should let localizers choose the most appropriate sites for their locales.
When considering this double check the tracking code. I think some of that is hardcoded.
| Reporter | ||
Updated•16 years ago
|
Severity: normal → enhancement
Priority: -- → P3
Target Milestone: --- → Future
| Reporter | ||
Comment 2•14 years ago
|
||
Hiro: this is an option if you'd like to work on something. The current ones are hardcoded and we haven't had any other requests to change these except from Japan so I'd be comfortable not making a UI for changing them and just putting an "if (locale==ja)" in the code and showing the ones that are most appropriate for you.
| Assignee | ||
Comment 3•14 years ago
|
||
Wil, thank you for your suggestion. But I would actually like to propose another solution that gives localizers choices which "sharing" service uses in each locale.
This patch adds three classes for such services as place holder. If the localizer translate the shortname of the class, the service is shown in the "share this" menu.
Having said that, I am having a mind to respect your suggestion, so I will post another patch to address the suggestion.
Assignee: nobody → hiikezoe
| Assignee | ||
Comment 4•14 years ago
|
||
This is a diff for testing in ja locale. This needs new translation.
diff --git a/apps/sharing/tests.py b/apps/sharing/tests.py
index 2ec5a74..2319a3a 100644
--- a/apps/sharing/tests.py
+++ b/apps/sharing/tests.py
@@ -103,3 +103,9 @@ def test_get_services_in_en_locale():
# The order is the same as the order of sharing.SERVICES_LIST
assert(['digg', 'facebook', 'delicious', 'myspace', 'friendfeed', 'twitter'] ==
[s.shortname for s in sharing.get_services()])
+
+
+def test_get_services_in_ja_locale():
+ tower.activate('ja')
+ assert(['digg', 'facebook', 'delicious', 'myspace', 'friendfeed', 'twitter', 'hatenabookmark'] ==
+ [s.shortname for s in sharing.get_services()])
This is the transation.
Index: ja/LC_MESSAGES/messages.po
===================================================================
--- ja/LC_MESSAGES/messages.po (revision 96075)
+++ ja/LC_MESSAGES/messages.po (working copy)
@@ -9608,6 +9608,25 @@
msgstr[0] "{0} 件のツイート"
msgstr[1] "{0} 件のツイート"
+#. L10n: Change this for local domestic service. Do not use non-ascii characters
+#: apps/sharing/__init__.py:78
+msgid "localservice1"
+msgstr "hatenabookmark"
+
+#: apps/sharing/__init__.py:79
+msgid "Post to localservice1"
+msgstr "はてなブックマークへ投稿"
+
+#: apps/sharing/__init__.py:80
+msgid "http://localservice1/?url={url}&title={title}"
+msgstr "http://b.hatena.ne.jp/append?{url}"
+
+#: apps/sharing/__init__.py:84
+msgid "{0} post on localservice1"
+msgid_plural "{0} posts on localservice1"
+msgstr[0] "{0} 件のブックマーク"
+msgstr[1] "{0} 件のブックマーク"
+
#: apps/sharing/templates/sharing/sharing_widget.html:2
msgid "Share this Add-on"
msgstr "このアドオンを共有"
| Assignee | ||
Comment 5•14 years ago
|
||
Here is another solution. Just adding a class for Hatena::Bookmark[1], a popular social bookmark service in Japan.
I'd like to leave the decision which patch should be appropriate for this issue.
[1] http://b.hatena.ne.jp/ (in Japanese only)
| Reporter | ||
Comment 6•14 years ago
|
||
That's an interesting idea. With some explanation to localizers that would fix it for everyone at once, which is a great idea. I'll pull this into our next milestone to check out. Thanks for the patches.
Target Milestone: Future → 6.2.9
| Reporter | ||
Comment 7•14 years ago
|
||
I cleaned up your first patch for pep8 and committed it to a branch on github for viewing/comments: https://github.com/clouserw/zamboni/commit/8a69e40335c76a10913d1c6b0ee0f07d080df0d5
Can you make another patch with a unit test that shows that localizing the LOCALSERVICE1 class actually does make it show up in the list and only for the localized locale?
The patch works when I tried it, but I want to avoid regressions when stuff lands in the future. Thanks!
| Reporter | ||
Updated•14 years ago
|
Target Milestone: 6.2.9 → 6.3.0
| Reporter | ||
Comment 8•14 years ago
|
||
Oh, and I changed the L10n comments to point to our wiki so we could explain what we're doing here. I haven't updated the wiki yet, but let's assume I write something there. :)
| Reporter | ||
Updated•14 years ago
|
Target Milestone: 6.3.0 → 4.x (triaged)
| Reporter | ||
Comment 9•14 years ago
|
||
Hiro: do you have time to add the test in comment 7? This is ready to land aside from that and it would be great to get it in, particularly before the patch is too far out of date to use.
| Assignee | ||
Comment 10•14 years ago
|
||
Sure. I will post the test within a week. I am sorry that my response is late. I missed the comment in comment 7.
| Assignee | ||
Comment 11•14 years ago
|
||
This patch needs a modification of tower because tower does not allow to change the directory which includes catalog files.
I will post the patch for tower.
| Assignee | ||
Comment 12•14 years ago
|
||
Use LOCALE_PATHS in settings for catalog directory.
| Assignee | ||
Comment 13•14 years ago
|
||
After attachment 579185 [details] [diff] [review] is applied, the comment at https://github.com/clouserw/zamboni/blob/hiroyuki/apps/amo/tests/test_locales.py#L16 will be invalid.
| Reporter | ||
Comment 14•14 years ago
|
||
I'm wary of adding a top level directory for locale_test/ and patching tower. I think this can be accomplished in a simpler fashion. What do you think of this self contained test: https://github.com/clouserw/zamboni/commit/8ff3394d4f52949a42783afd4f549851dd2b424a#L3R124
| Assignee | ||
Comment 15•14 years ago
|
||
Wow! Great! I did not know patch_object method!
I supposed that the test should be run through gettext function, but I was wrong. The test should be independent gettext function. That's very informative for me! Thanks!
| Reporter | ||
Comment 16•14 years ago
|
||
Mock and Patch confuse me every time I use them - they are awesome. :)
I wrote some documentation for this at https://wiki.mozilla.org/AMO:Localizers#What_is_localservice1_in_the_.po_files but I thought it would be better with a real example. Can you fill in the example .po block with a real service?
Thanks for all your help. This is looking great.
| Assignee | ||
Comment 17•14 years ago
|
||
(In reply to Wil Clouser [:clouserw] from comment #16)
> Mock and Patch confuse me every time I use them - they are awesome. :)
>
> I wrote some documentation for this at
> https://wiki.mozilla.org/AMO:Localizers#What_is_localservice1_in_the_.
> po_files but I thought it would be better with a real example. Can you fill
> in the example .po block with a real service?
Done! Thank you for the detailed document!
> Thanks for all your help. This is looking great.
Thank you for your cooperation too!
Now this bug can be closed. Yay!
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 18•14 years ago
|
||
Close, but not quite. The patch is still being reviewed at https://github.com/clouserw/zamboni/commit/8ff3394d4f52949a42783afd4f549851dd2b424a . I'll try to land it this week though and I'll close this then.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Assignee | ||
Comment 19•14 years ago
|
||
I am sorry for the rush.
| Reporter | ||
Comment 20•14 years ago
|
||
Good news, I landed this today and extracted to the .po files. Can you edit the .po and then we can see if it works on -dev? :)
Status: REOPENED → RESOLVED
Closed: 14 years ago → 14 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 21•14 years ago
|
||
I asked Tomoya to change the .po file. He is the guy who can do it. ;-p
| Reporter | ||
Comment 22•14 years ago
|
||
I made some more minor adjustments and changed your .po file to add the service to test it out. Feel free to change that, of course.
I also emailed dev-l10n-web@ about it. Thanks for your help, it's looking good.
| Reporter | ||
Comment 23•14 years ago
|
||
You can see it in action at https://addons-dev.allizom.org/ja/firefox/addon/adblock-plus/#
Updated•9 years ago
|
Product: addons.mozilla.org → addons.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•