Closed Bug 464425 Opened 16 years ago Closed 15 years ago

Local Folders untranslated account name in fresh profiles

Categories

(MailNews Core :: Localization, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
Thunderbird 3.0b2

People

(Reporter: stef, Assigned: Bienvenu)

References

Details

(Keywords: l12y)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.9.0.3) Gecko/2008111021 Firefox/3.0.3 Flock/2.0.0
Build Identifier: 

With recent trunk l10n nightly builds (polish ones precisely) when I create fresh profile, it has english "Local Folders" account name instead localized one.

Reproducible: Always




screenshot: http://bugs.aviary.pl/attachment.cgi?id=1137

Originally reported as Aviary.pl bug 1980 by Bartosz Piec
http://bugs.aviary.pl/show_bug.cgi?id=1980
Looking at this, I see a few strings in mailnews/base/src/nsMsgAccountManager.cpp that seem to be hardcoded:

http://hg.mozilla.org/comm-central/annotate/c46241feb386/mailnews/base/src/nsMsgAccountManager.cpp#l295
http://hg.mozilla.org/comm-central/annotate/c46241feb386/mailnews/base/src/nsMsgAccountManager.cpp#l2082
http://hg.mozilla.org/comm-central/annotate/c46241feb386/mailnews/base/src/nsMsgAccountManager.cpp#l2089
http://hg.mozilla.org/comm-central/annotate/c46241feb386/mailnews/base/src/nsMsgAccountManager.cpp#l2110
http://hg.mozilla.org/comm-central/annotate/c46241feb386/mailnews/base/src/nsMsgAccountManager.cpp#l2116

There are also some instances of NS_LITERAL_CSTRING("nobody") or NS_LITERAL_CSTRING("none") in that file, where I'm not sure whether those should be localizable or not.

CC'ing bienvenu for input.
Component: General → Localization
Product: Thunderbird → MailNews Core
QA Contact: general → localization
Keywords: l12y
(In reply to comment #1)
> There are also some instances of NS_LITERAL_CSTRING("nobody") or
> NS_LITERAL_CSTRING("none") in that file, where I'm not sure whether those
> should be localizable or not.

"none" is the server type. It should definitely not be localizable.

The "nobody" is the username of the Local Folders account, which shouldn't be cropping up in the UI. The "Local Folders" is also a hostname--it should show up as much in the UI as (say) imap.example.com does.
this code here should be setting the pretty name to a localizable string, I think:

nsMsgAccountManager::CreateLocalMailAccount()
{
  // create the server
  nsCOMPtr<nsIMsgIncomingServer> server;
  nsresult rv = CreateIncomingServer(NS_LITERAL_CSTRING("nobody"),
                            NS_LITERAL_CSTRING("Local Folders"),
                            NS_LITERAL_CSTRING("none"), getter_AddRefs(server));
  NS_ENSURE_SUCCESS(rv,rv);
  
  // we don't want "nobody at Local Folders" to show up in the
  // folder pane, so we set the pretty name to "Local Folders"
  server->SetPrettyName(NS_LITERAL_STRING("Local Folders"));
Confirmed on recent nightlies on both the 1.8 branch (2.0.0.x builds) and comm-central (TB 3 builds) with fresh and existing profiles.
Status: UNCONFIRMED → NEW
Ever confirmed: true
No, this bug is about the account name itself, not the folders in the account.
Attached patch untested diffSplinter Review
this is a patch I worked up on the train. It's untested, and it only affects new profiles. I think to finish this, we would migrate old profiles such that localized builds would have the local folders name set to the localized version.
Comment on attachment 348579 [details] [diff] [review]
untested diff

I don't know if we're going to get to the full blown solution, so we might as well fix it for new profiles...

I broke out GetLocalFoldersPrettyName into its own routine so that it would be easier to write the code to fix existing profiles.
Attachment #348579 - Flags: superreview?(bugzilla)
Attachment #348579 - Flags: review?(bugzilla)
Comment on attachment 348579 [details] [diff] [review]
untested diff

>+{
>+  // we don't want "nobody at Local Folders" to show up in the
>+  // folder pane, so we set the pretty name to a localized "Local Folders"
>+  nsCOMPtr<nsIStringBundle> bundle;
>+  nsresult rv;
>+  nsCOMPtr<nsIStringBundleService> sBundleService =
>+  do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);

nit: the second line should be two-space indented.

>+  NS_ENSURE_SUCCESS(rv, rv);
>+  if (sBundleService)

nit: insert a blank line between these two please.

>+    rv = sBundleService->CreateBundle("chrome://messenger/locale/messenger.properties",
>+                                      getter_AddRefs(bundle));
>+  NS_ENSURE_SUCCESS(rv, rv);
>+  return bundle->GetStringFromName(NS_LITERAL_STRING("localFolders").get(), getter_Copies(localFoldersName));

nit: insert a blank line between these two please.
Attachment #348579 - Flags: superreview?(bugzilla)
Attachment #348579 - Flags: superreview+
Attachment #348579 - Flags: review?(bugzilla)
Attachment #348579 - Flags: review+
Assignee: nobody → bienvenu
fix checked in.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Reopening. This is still happening in the German build2 candidate for beta2 even though the relevant string is correctly translated as can be seen here http://hg.mozilla.org/releases/l10n-mozilla-1.9.1/de/annotate/cbdd8d9a167d/mail/chrome/messenger/messenger.properties#l166

Screenshot following.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Sorry, my mistake. I didn't use a fresh profile. Did that now and can verify that this works correctly. Sorry for the bugspam.
Status: REOPENED → RESOLVED
Closed: 15 years ago15 years ago
Resolution: --- → FIXED
Status: RESOLVED → VERIFIED
Target Milestone: --- → Thunderbird 3.0b2
You need to log in before you can comment on or make changes to this bug.