Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extensions/reviewed/TweenIntoView.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"iconUrl": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyMy4wLjMsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iSWNvbnMiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4Ig0KCSB2aWV3Qm94PSIwIDAgMzIgMzIiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDMyIDMyOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8Zz4NCgk8cGF0aCBkPSJNMjUsMTZjLTAuMywwLTAuNS0wLjEtMC43LTAuM2MtMC40LTAuNC0wLjQtMSwwLTEuNGwzLjMtMy4zbC0zLjMtMy4zYy0wLjQtMC40LTAuNC0xLDAtMS40czEtMC40LDEuNCwwbDQsNA0KCQljMC40LDAuNCwwLjQsMSwwLDEuNGwtNCw0QzI1LjUsMTUuOSwyNS4zLDE2LDI1LDE2eiIvPg0KPC9nPg0KPGc+DQoJPHBhdGggZD0iTTI5LDEySDdjLTAuNiwwLTEtMC40LTEtMXMwLjQtMSwxLTFoMjJjMC42LDAsMSwwLjQsMSwxUzI5LjYsMTIsMjksMTJ6Ii8+DQo8L2c+DQo8Zz4NCgk8cGF0aCBkPSJNNywyNmMtMC4zLDAtMC41LTAuMS0wLjctMC4zbC00LTRjLTAuNC0wLjQtMC40LTEsMC0xLjRsNC00YzAuNC0wLjQsMS0wLjQsMS40LDBzMC40LDEsMCwxLjRMNC40LDIxbDMuMywzLjMNCgkJYzAuNCwwLjQsMC40LDEsMCwxLjRDNy41LDI1LjksNy4zLDI2LDcsMjZ6Ii8+DQo8L2c+DQo8Zz4NCgk8cGF0aCBkPSJNMjUsMjJIM2MtMC42LDAtMS0wLjQtMS0xczAuNC0xLDEtMWgyMmMwLjYsMCwxLDAuNCwxLDFTMjUuNiwyMiwyNSwyMnoiLz4NCjwvZz4NCjwvc3ZnPg0K",
"name": "TweenIntoView",
"previewIconUrl": "https://asset-resources.gdevelop.io/public-resources/Icons/Glyphster Pack/Master/SVG/Arrows/557b3471ae92fa5c744b9bf14b8803a0c7745c224ed9cfe80037a8ac7295d99e_Arrows_thin_arrow_left_right_directions.svg",
"shortDescription": "Tween objects into position from off screen.\n",
"shortDescription": "Tween objects into position from off screen.",
"version": "1.0.0",
"description": [
"Tween objects into position from off screen, or from a set distance, to create a polished visual effect.",
Expand Down
36 changes: 25 additions & 11 deletions scripts/extract-all-translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ try {
if (data[key]) {
/** @type {string[]} */
const values = Array.isArray(data[key]) ? data[key] : [data[key]];
values.forEach((value) => {
if (value.trim()) {
values.forEach((rawValue) => {
const value = rawValue.trim();
if (value) {
if (!translationsMap.has(value)) {
translationsMap.set(value, []);
}
Expand Down Expand Up @@ -201,9 +202,9 @@ try {

console.log('ℹ️ Creating .POT content...');
// Step 3: Build POT content
const generatedMsgids = new Set();
translationsMap.forEach((files, value) => {
const uniqueFiles = [...new Set(files)];
potContent += uniqueFiles.map((file) => `#: ${file}`).join('\n') + '\n';

// Handle multi-line strings
const escapedValue = value
Expand All @@ -213,14 +214,27 @@ try {
/** @type {string[]} */
let lines = escapedValue.split('\n');
lines = lines.filter((line) => line.trim());
potContent +=
'msgid ' +
lines
.map((line, index) =>
index === lines.length - 1 ? `"${line}"` : `"${line}\\n"`
)
.join('\n') +
'\n';
const msgidContent = lines
.map((line, index) =>
index === lines.length - 1 ? `"${line}"` : `"${line}\\n"`
)
.join('\n');

// Skip if this msgid was already generated (safety net for edge cases
// where two different source strings produce the same msgid after escaping).
if (generatedMsgids.has(msgidContent)) {
console.warn(
`⚠️ Skipping duplicate msgid ${msgidContent.slice(
0,
60
)} (from: ${uniqueFiles.join(', ')})`
);
return;
}
generatedMsgids.add(msgidContent);

potContent += uniqueFiles.map((file) => `#: ${file}`).join('\n') + '\n';
potContent += 'msgid ' + msgidContent + '\n';
potContent += 'msgstr ""\n\n';
});

Expand Down