Ticket #6063: mount_serverLocalization.patch

File mount_serverLocalization.patch, 5.7 KB (added by Karvjorm, 14 years ago)

An updated localization patch for mount_server.

  • src/servers/mount/AutoMounter.cpp

     
    1212
    1313#include <Alert.h>
    1414#include <AutoLocker.h>
     15#include <Catalog.h>
    1516#include <Debug.h>
    1617#include <Directory.h>
    1718#include <DiskDevice.h>
     
    2223#include <FindDirectory.h>
    2324#include <fs_info.h>
    2425#include <fs_volume.h>
     26#include <Locale.h>
    2527#include <Message.h>
    2628#include <Node.h>
    2729#include <NodeMonitor.h>
     
    3436#include "MountServer.h"
    3537
    3638
     39#define B_TRANSLATE_CONTEXT "AutoMounter"
     40
     41
    3742static const char* kMountServerSettings = "mount_server";
    3843static const uint32 kMsgInitialScan = 'insc';
    3944static const char* kMountFlagsKeyExtension = " mount flags";
     
    328333    switch (message->what) {
    329334        case B_EXECUTE_PROPERTY:
    330335            if (strcmp("InitialScan", property) == 0) {
    331 printf("performing initial scan.\n");
     336                printf(B_TRANSLATE("performing initial scan.\n"));
    332337                _MountVolumes(fNormalMode, fRemovableMode, true);
    333                 err = reply.AddString("result", "Previous volumes mounted.");
     338                err = reply.AddString("result", B_TRANSLATE("Previous volumes mounted."));
    334339            }
    335340            break;
    336341    }
     
    378383    if (askReadOnly) {
    379384        // Suggest to the user to mount read-only until Haiku is more mature.
    380385        BString string;
    381         string << "Mounting volume ";
    382         if (partition->ContentName() != NULL)
    383             string << "'" << partition->ContentName() << "'\n\n";
     386        if (partition->ContentName() != NULL) {
     387            char str1[127], str2[127];
     388            int len = 0;
     389            len = sprintf(str1, "%s", B_TRANSLATE("Mounting volume '%s'\n\n"));
     390            str1[len] = '\0';
     391            len = sprintf(str2, str1, partition->ContentName());
     392            str2[len] = '\0';
     393            string << str2;
     394        }
    384395        else
    385             string << "<unnamed volume>\n\n";
     396            string << B_TRANSLATE("Mounting volume <unnamed volume>\n\n");
     397
    386398        // TODO: Use distro name instead of "Haiku"...
    387399        if (!isBFS) {
    388             string << "The file system on this volume is not the Haiku file "
    389                 "system. It is strongly suggested to mount it in read-only "
    390                 "mode. ";
     400            string << B_TRANSLATE("The file system on this volume is not the "
     401                "Haiku file system. It is strongly suggested to mount it in "
     402                "read-only mode. This will prevent unintentional data loss "
     403                "because of errors in Haiku.");
    391404        } else {
    392             string << "It is suggested to mount all additional Haiku volumes "
    393                 "in read-only mode. ";
     405            string << B_TRANSLATE("It is suggested to mount all additional "
     406                "Haiku volumes in read-only mode. This will prevent "
     407                "unintentional data loss because of errors in Haiku.");
    394408        }
    395         string << "This will prevent unintentional data loss because of "
    396             "errors in Haiku.";
    397         BAlert* alert = new BAlert("Mount warning", string.String(),
    398             "Mount read/write", "Cancel", "Mount read-only",
     409
     410        BAlert* alert = new BAlert(B_TRANSLATE("Mount warning"),
     411            string.String(), B_TRANSLATE("Mount read/write"),
     412            B_TRANSLATE("Cancel"), B_TRANSLATE("Mount read-only"),
    399413            B_WIDTH_FROM_WIDEST, B_WARNING_ALERT);
    400414        alert->SetShortcut(1, B_ESCAPE);
    401415        int32 choice = alert->Go();
     
    547561    status_t status = partition->Mount(NULL, mountFlags);
    548562    if (status < B_OK) {
    549563        BString string;
    550         string << "Error mounting volume. (" << strerror(status) << ")";
    551             (new BAlert("", string.String(), "OK"))->Go(NULL);
     564        string << B_TRANSLATE("Error mounting volume.");
     565        string << " (" << strerror(status)  << ")";
     566        (new BAlert("", string.String(), B_TRANSLATE("OK")))->Go(NULL);
    552567    }
    553568}
    554569
     
    557572AutoMounter::_SuggestForceUnmount(const char* name, status_t error)
    558573{
    559574    BString text;
    560     text << "Could not unmount disk \"" << name << "\":\n\t";
     575    text << B_TRANSLATE("Could not unmount disk");
     576    text << " \"" << name << "\":\n\t";
    561577    text << strerror(error);
    562     text << "\n\nShould unmounting be forced?\n\n"
     578    text << "\n\n";
     579    text << B_TRANSLATE("Should unmounting be forced?\n\n"
    563580        "Note: If an application is currently writing to the volume, "
    564         "unmounting it now might result in loss of data.\n";
     581        "unmounting it now might result in loss of data.\n");
    565582
    566     BAlert* alert = new BAlert("", text.String(), "Cancel", "Force unmount",
    567         NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     583    BAlert* alert = new BAlert("", text.String(), B_TRANSLATE("Cancel"),
     584        B_TRANSLATE("Force unmount"), NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    568585    alert->SetShortcut(0, B_ESCAPE);
    569586    int32 choice = alert->Go();
    570587
     
    576593AutoMounter::_ReportUnmountError(const char* name, status_t error)
    577594{
    578595    BString text;
    579     text << "Could not unmount disk \"" << name << "\":\n\t";
     596    text << B_TRANSLATE("Could not unmount disk");
     597    text << " \"" << name << "\":\n\t";
    580598    text << strerror(error);
    581599
    582     (new BAlert("", text.String(), "OK", NULL, NULL, B_WIDTH_AS_USUAL,
    583         B_WARNING_ALERT))->Go(NULL);
     600    (new BAlert("", text.String(), B_TRANSLATE("OK"), NULL, NULL,
     601        B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(NULL);
    584602}
    585603
    586604
     
    903921int
    904922main(int argc, char* argv[])
    905923{
     924    BCatalog fAppCatalog;
    906925    AutoMounter app;
     926   
     927    be_locale->GetAppCatalog(&fAppCatalog);
     928   
    907929    app.Run();
    908930    return 0;
    909931}
  • src/servers/mount/Jamfile

     
    11SubDir HAIKU_TOP src servers mount ;
    22
     3SubDirHdrs HAIKU_TOP headers os locale ;
     4
    35UsePrivateHeaders mount shared storage ;
    46
    57Server mount_server
     
    79    AutoMounter.cpp
    810#   AutoMounterSettings.cpp
    911    :
    10     libbe.so
     12    libbe.so liblocale.so
    1113    $(TARGET_LIBSTDC++)
    1214    :
    1315    mount_server.rdef
    1416;
     17
     18DoCatalogs mount_server :
     19    x-vnd.Haiku-mount_server
     20    :
     21    AutoMounter.cpp
     22    : en.catkeys
     23;