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",
"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": [
"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"

View File

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