add pt-BR configs

This commit is contained in:
Murilo Schunke 2025-11-27 11:23:50 -03:00
parent 38ec057eef
commit 333f59feec
2 changed files with 26 additions and 31 deletions

View File

@ -1,7 +1,22 @@
{ {
"$schema": "https://inlang.com/schema/project-settings", "$schema": "https://inlang.com/schema/project-settings",
"baseLocale": "en", "baseLocale": "en",
"locales": ["en", "es", "fr", "de", "it", "hr", "tr", "ja", "ko", "el", "id", "zh-Hans", "zh-Hant"], "locales": [
"en",
"es",
"fr",
"de",
"it",
"hr",
"tr",
"ja",
"ko",
"el",
"id",
"zh-Hans",
"zh-Hant",
"pt-BR"
],
"modules": [ "modules": [
"https://cdn.jsdelivr.net/npm/@inlang/plugin-message-format@4/dist/index.js", "https://cdn.jsdelivr.net/npm/@inlang/plugin-message-format@4/dist/index.js",
"https://cdn.jsdelivr.net/npm/@inlang/plugin-m-function-matcher@2/dist/index.js" "https://cdn.jsdelivr.net/npm/@inlang/plugin-m-function-matcher@2/dist/index.js"

View File

@ -126,11 +126,9 @@ class Files {
// check if completely transparent // check if completely transparent
const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height); const imageData = ctx.getImageData(0, 0, canvas.width, canvas.height);
const isTransparent = Array.from(imageData.data).every( const isTransparent = Array.from(imageData.data).every((value, index) => {
(value, index) => { return (index + 1) % 4 !== 0 || value === 0;
return (index + 1) % 4 !== 0 || value === 0; });
},
);
if (isTransparent) { if (isTransparent) {
canvas.remove(); canvas.remove();
return undefined; return undefined;
@ -177,8 +175,7 @@ class Files {
} }
const converterCount = convertersUsed.size; const converterCount = convertersUsed.size;
const canConvertAsOne = const canConvertAsOne = converterCount === 1 && !incompatibleFiles;
converterCount === 1 && !incompatibleFiles;
log( log(
["files"], ["files"],
@ -274,9 +271,7 @@ class Files {
} }
const converter = converters const converter = converters
.sort(byNative(format)) .sort(byNative(format))
.find((converter) => .find((converter) => converter.formatStrings().includes(format));
converter.formatStrings().includes(format),
);
if (!converter) { if (!converter) {
log(["files"], `no converter found for ${file.name}`); log(["files"], `no converter found for ${file.name}`);
this.files.push(new VertFile(file, format)); this.files.push(new VertFile(file, format));
@ -317,10 +312,7 @@ class Files {
action: () => { action: () => {
this.files = [ this.files = [
...this.files.filter( ...this.files.filter(
(f) => (f) => !f.converters.map((c) => c.name).includes("vertd"),
!f.converters
.map((c) => c.name)
.includes("vertd"),
), ),
]; ];
this._warningShown = false; this._warningShown = false;
@ -329,10 +321,7 @@ class Files {
{ {
text: m["convert.external_warning.yes"](), text: m["convert.external_warning.yes"](),
action: () => { action: () => {
localStorage.setItem( localStorage.setItem("acceptedExternalWarning", "true");
"acceptedExternalWarning",
"true",
);
this._warningShown = false; this._warningShown = false;
}, },
}, },
@ -348,14 +337,7 @@ class Files {
public add(file: VertFile[] | null | undefined): void; public add(file: VertFile[] | null | undefined): void;
public add(file: FileList | null | undefined): void; public add(file: FileList | null | undefined): void;
public add( public add(
file: file: VertFile | File | VertFile[] | File[] | FileList | null | undefined,
| VertFile
| File
| VertFile[]
| File[]
| FileList
| null
| undefined,
) { ) {
if (!file) return; if (!file) return;
if (Array.isArray(file) || file instanceof FileList) { if (Array.isArray(file) || file instanceof FileList) {
@ -470,6 +452,7 @@ export const availableLocales = {
el: "Ελληνικά", el: "Ελληνικά",
"zh-Hans": "简体中文", "zh-Hans": "简体中文",
"zh-Hant": "繁體中文", "zh-Hant": "繁體中文",
"pt-BR": "Português (Brasil)",
}; };
export function updateLocale(newLocale: string) { export function updateLocale(newLocale: string) {
@ -567,10 +550,7 @@ export const getMaxArrayBufferSize = (): number => {
const cached = localStorage.getItem("maxArrayBufferSize"); const cached = localStorage.getItem("maxArrayBufferSize");
if (cached) { if (cached) {
const parsed = Number(cached); const parsed = Number(cached);
log( log(["converters"], `using cached max ArrayBuffer size: ${parsed} bytes`);
["converters"],
`using cached max ArrayBuffer size: ${parsed} bytes`,
);
if (!isNaN(parsed) && parsed > 0) return parsed; if (!isNaN(parsed) && parsed > 0) return parsed;
} }