Skip to content

Localize buttons makes them squared inside groups #96

@schroef

Description

@schroef

Im updating this CEP panel which has many script and a couple dialog windows. Ive started now adding localize to it and notice some weird behavior which i can find in the resources ive found.

The "issue" im seeing is that when buttons have hard-coded text, defined when they are created. Buttons show with round borders. When i use localize and they are placed inside a group, they get squared off in the corners. But when it uses English they show with rounded corners.
buttons inside groups squared dutch

Ive got an example script here. Its perhaps hard to test since you need to have Photoshop with different languages installed. Ive installed different languages by copying the packs when you install the app. Some are old so i guess its misses some parts.

Do you perhaps have knowledge of this?
I see this happening on Windows by the way, OSX doesnt show this.

Ive looked in the Javscript toolguide, the ScriptUI for dummies by Peter Kahrel, tried PS-Script.com (nothing found yet)

// enable double clicking from the Finder or Explorer
#target photoshop

//Make Photoshop the front most application
app.bringToFront();

// Javascript toolsguide cs5
var locCancelBtn = {
    en: "Cancel",
    es: "Cancelar",
    fr: "XXXXXXXXX",
    nl: "Annuleer",
    ch: "XXXXXXXX"
};
testLbl = {
    en: "Test",
    nl: "Testen"
};
$.localization = true;

var dlg = new Window("dialog", "Alert Box Builder");
    btnPnl = dlg.add("panel", undefined, "Build it");

var testBtn = btnPnl.add("button", undefined,  localize(testBtn), {
    name: "test"
});
var buildBtn = btnPnl.add("button", undefined, "Build", {
    name: "ok"
});
var cancelBtn = btnPnl.add("button", undefined, "Cancel", {
    name: "cancel"
});
// BUTTONGROUP
    // ===========
    var buttonGroup = dlg.add("group", undefined, {name: "buttonGroup"}); 
        // buttonGroup.orientation = "row"; 
        // buttonGroup.alignChildren = ["right","center"]; 
        // buttonGroup.spacing = 8; 
        // buttonGroup.margins = [0,10,0,0]; 
        // buttonGroup.alignment = ["fill","top"]; 
var testBtn = buttonGroup.add("button", undefined,  localize(testLbl), {
    name: "test"
});
var buildBtn = buttonGroup.add("button", undefined, "Build", {
    name: "ok"
});
var cancelBtn = buttonGroup.add("button", undefined, "Cancel", {
    name: "cancel"
});
dlg.show();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions