PSDTranslator: Localization.
This commit is contained in:
@@ -4,21 +4,25 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ConfigView.h"
|
#include "ConfigView.h"
|
||||||
#include "PSDTranslator.h"
|
|
||||||
|
|
||||||
#include <StringView.h>
|
#include <Catalog.h>
|
||||||
#include <SpaceLayoutItem.h>
|
|
||||||
#include <ControlLook.h>
|
#include <ControlLook.h>
|
||||||
#include <PopUpMenu.h>
|
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
|
#include <PopUpMenu.h>
|
||||||
|
#include <SpaceLayoutItem.h>
|
||||||
|
#include <StringView.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "PSDLoader.h"
|
#include "PSDLoader.h"
|
||||||
|
#include "PSDTranslator.h"
|
||||||
|
|
||||||
|
#undef B_TRANSLATION_CONTEXT
|
||||||
|
#define B_TRANSLATION_CONTEXT "PSDConfig"
|
||||||
|
|
||||||
|
|
||||||
ConfigView::ConfigView(TranslatorSettings *settings)
|
ConfigView::ConfigView(TranslatorSettings *settings)
|
||||||
: BGroupView("PSDTranslator Settings", B_VERTICAL, 0)
|
: BGroupView(B_TRANSLATE("PSDTranslator Settings"), B_VERTICAL, 0)
|
||||||
{
|
{
|
||||||
fSettings = settings;
|
fSettings = settings;
|
||||||
|
|
||||||
@@ -27,31 +31,33 @@ ConfigView::ConfigView(TranslatorSettings *settings)
|
|||||||
uint32 currentCompression =
|
uint32 currentCompression =
|
||||||
fSettings->SetGetInt32(PSD_SETTING_COMPRESSION);
|
fSettings->SetGetInt32(PSD_SETTING_COMPRESSION);
|
||||||
|
|
||||||
_AddItemToMenu(compressionPopupMenu, "Uncompressed",
|
_AddItemToMenu(compressionPopupMenu, B_TRANSLATE("Uncompressed"),
|
||||||
MSG_COMPRESSION_CHANGED, PSD_COMPRESSED_RAW, currentCompression);
|
MSG_COMPRESSION_CHANGED, PSD_COMPRESSED_RAW, currentCompression);
|
||||||
_AddItemToMenu(compressionPopupMenu, "RLE",
|
_AddItemToMenu(compressionPopupMenu, B_TRANSLATE("RLE"),
|
||||||
MSG_COMPRESSION_CHANGED, PSD_COMPRESSED_RLE, currentCompression);
|
MSG_COMPRESSION_CHANGED, PSD_COMPRESSED_RLE, currentCompression);
|
||||||
|
|
||||||
fCompressionField = new BMenuField("compression",
|
fCompressionField = new BMenuField("compression",
|
||||||
"Compression: ", compressionPopupMenu);
|
B_TRANSLATE("Compression: "), compressionPopupMenu);
|
||||||
|
|
||||||
BPopUpMenu* versionPopupMenu = new BPopUpMenu("popup_version");
|
BPopUpMenu* versionPopupMenu = new BPopUpMenu("popup_version");
|
||||||
|
|
||||||
uint32 currentVersion =
|
uint32 currentVersion =
|
||||||
fSettings->SetGetInt32(PSD_SETTING_VERSION);
|
fSettings->SetGetInt32(PSD_SETTING_VERSION);
|
||||||
|
|
||||||
_AddItemToMenu(versionPopupMenu, "Photoshop Document (PSD File)",
|
_AddItemToMenu(versionPopupMenu,
|
||||||
MSG_VERSION_CHANGED, PSD_FILE, currentVersion);
|
B_TRANSLATE("Photoshop Document (PSD File)"), MSG_VERSION_CHANGED,
|
||||||
_AddItemToMenu(versionPopupMenu, "Photoshop Big Document (PSB File)",
|
PSD_FILE, currentVersion);
|
||||||
MSG_VERSION_CHANGED, PSB_FILE, currentVersion);
|
_AddItemToMenu(versionPopupMenu,
|
||||||
|
B_TRANSLATE("Photoshop Big Document (PSB File)"), MSG_VERSION_CHANGED,
|
||||||
|
PSB_FILE, currentVersion);
|
||||||
|
|
||||||
fVersionField = new BMenuField("version",
|
fVersionField = new BMenuField("version",
|
||||||
"Format: ", versionPopupMenu);
|
B_TRANSLATE("Format: "), versionPopupMenu);
|
||||||
|
|
||||||
BAlignment leftAlignment(B_ALIGN_LEFT, B_ALIGN_VERTICAL_UNSET);
|
BAlignment leftAlignment(B_ALIGN_LEFT, B_ALIGN_VERTICAL_UNSET);
|
||||||
|
|
||||||
BStringView *stringView = new BStringView("title",
|
BStringView *stringView = new BStringView("title",
|
||||||
"Photoshop image translator");
|
B_TRANSLATE("Photoshop image translator"));
|
||||||
stringView->SetFont(be_bold_font);
|
stringView->SetFont(be_bold_font);
|
||||||
stringView->SetExplicitAlignment(leftAlignment);
|
stringView->SetExplicitAlignment(leftAlignment);
|
||||||
AddChild(stringView);
|
AddChild(stringView);
|
||||||
@@ -60,7 +66,7 @@ ConfigView::ConfigView(TranslatorSettings *settings)
|
|||||||
AddChild(BSpaceLayoutItem::CreateVerticalStrut(spacing));
|
AddChild(BSpaceLayoutItem::CreateVerticalStrut(spacing));
|
||||||
|
|
||||||
char version[256];
|
char version[256];
|
||||||
sprintf(version, "Version %d.%d.%d, %s",
|
sprintf(version, B_TRANSLATE("Version %d.%d.%d, %s"),
|
||||||
int(B_TRANSLATION_MAJOR_VERSION(PSD_TRANSLATOR_VERSION)),
|
int(B_TRANSLATION_MAJOR_VERSION(PSD_TRANSLATOR_VERSION)),
|
||||||
int(B_TRANSLATION_MINOR_VERSION(PSD_TRANSLATOR_VERSION)),
|
int(B_TRANSLATION_MINOR_VERSION(PSD_TRANSLATOR_VERSION)),
|
||||||
int(B_TRANSLATION_REVISION_VERSION(PSD_TRANSLATOR_VERSION)),
|
int(B_TRANSLATION_REVISION_VERSION(PSD_TRANSLATOR_VERSION)),
|
||||||
|
|||||||
@@ -5,8 +5,14 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "PSDLoader.h"
|
#include "PSDLoader.h"
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
|
|
||||||
#include "BaseTranslator.h"
|
#include "BaseTranslator.h"
|
||||||
|
|
||||||
|
#undef B_TRANSLATION_CONTEXT
|
||||||
|
#define B_TRANSLATION_CONTEXT "PSDLoader"
|
||||||
|
|
||||||
|
|
||||||
PSDLoader::PSDLoader(BPositionIO *src)
|
PSDLoader::PSDLoader(BPositionIO *src)
|
||||||
{
|
{
|
||||||
@@ -107,21 +113,21 @@ PSDLoader::ColorFormatName(void)
|
|||||||
{
|
{
|
||||||
switch (fColorFormat) {
|
switch (fColorFormat) {
|
||||||
case PSD_COLOR_MODE_BITS:
|
case PSD_COLOR_MODE_BITS:
|
||||||
return "Bitmap";
|
return B_TRANSLATE("Bitmap");
|
||||||
case PSD_COLOR_MODE_GRAYSCALE:
|
case PSD_COLOR_MODE_GRAYSCALE:
|
||||||
return "Grayscale";
|
return B_TRANSLATE("Grayscale");
|
||||||
case PSD_COLOR_MODE_INDEXED:
|
case PSD_COLOR_MODE_INDEXED:
|
||||||
return "Indexed";
|
return B_TRANSLATE("Indexed");
|
||||||
case PSD_COLOR_MODE_RGB:
|
case PSD_COLOR_MODE_RGB:
|
||||||
return fChannels > 3 ? "RGBA" : "RGB";
|
return fChannels > 3 ? B_TRANSLATE("RGBA") : B_TRANSLATE("RGB");
|
||||||
case PSD_COLOR_MODE_CMYK:
|
case PSD_COLOR_MODE_CMYK:
|
||||||
return "CMYK";
|
return B_TRANSLATE("CMYK");
|
||||||
case PSD_COLOR_MODE_MULTICHANNEL:
|
case PSD_COLOR_MODE_MULTICHANNEL:
|
||||||
return "Multichannel";
|
return B_TRANSLATE("Multichannel");
|
||||||
case PSD_COLOR_MODE_LAB:
|
case PSD_COLOR_MODE_LAB:
|
||||||
return "Lab";
|
return B_TRANSLATE("Lab");
|
||||||
case PSD_COLOR_MODE_DUOTONE:
|
case PSD_COLOR_MODE_DUOTONE:
|
||||||
return "Duotone";
|
return B_TRANSLATE("Duotone");
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,15 +4,21 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include "PSDTranslator.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
|
|
||||||
#include "ConfigView.h"
|
#include "ConfigView.h"
|
||||||
#include "PSDTranslator.h"
|
|
||||||
#include "PSDLoader.h"
|
#include "PSDLoader.h"
|
||||||
#include "PSDWriter.h"
|
#include "PSDWriter.h"
|
||||||
|
|
||||||
|
#undef B_TRANSLATION_CONTEXT
|
||||||
|
#define B_TRANSLATION_CONTEXT "PSDTranslator"
|
||||||
|
|
||||||
const char *kDocumentCount = "/documentCount";
|
const char *kDocumentCount = "/documentCount";
|
||||||
const char *kDocumentIndex = "/documentIndex";
|
const char *kDocumentIndex = "/documentIndex";
|
||||||
|
|
||||||
@@ -74,8 +80,8 @@ const uint32 kNumDefaultSettings = sizeof(sDefaultSettings)
|
|||||||
|
|
||||||
|
|
||||||
PSDTranslator::PSDTranslator()
|
PSDTranslator::PSDTranslator()
|
||||||
: BaseTranslator(kPSDName,
|
: BaseTranslator(B_TRANSLATE(kPSDName),
|
||||||
"Photoshop image translator",
|
B_TRANSLATE("Photoshop image translator"),
|
||||||
PSD_TRANSLATOR_VERSION,
|
PSD_TRANSLATOR_VERSION,
|
||||||
sInputFormats, kNumInputFormats,
|
sInputFormats, kNumInputFormats,
|
||||||
sOutputFormats, kNumOutputFormats,
|
sOutputFormats, kNumOutputFormats,
|
||||||
@@ -109,9 +115,9 @@ PSDTranslator::DerivedIdentify(BPositionIO *stream,
|
|||||||
info->group = B_TRANSLATOR_BITMAP;
|
info->group = B_TRANSLATOR_BITMAP;
|
||||||
info->quality = PSD_IN_QUALITY;
|
info->quality = PSD_IN_QUALITY;
|
||||||
info->capability = PSD_IN_CAPABILITY;
|
info->capability = PSD_IN_CAPABILITY;
|
||||||
BString name(kPSDName);
|
snprintf(info->name, sizeof(info->name),
|
||||||
name << " (" << psdFile.ColorFormatName() << ")";
|
B_TRANSLATE(kPSDName " (%s)"),
|
||||||
strcpy(info->name, name.String());
|
psdFile.ColorFormatName().String());
|
||||||
strcpy(info->MIME, kPSDMimeType);
|
strcpy(info->MIME, kPSDMimeType);
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|||||||
Reference in New Issue
Block a user