Skip to content

Commit

Permalink
Merge branch 'main' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-bodnar committed Oct 15, 2024
2 parents baec0ab + 263faa5 commit fd17843
Show file tree
Hide file tree
Showing 84 changed files with 7,461 additions and 5,972 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [4.13.0](https://github.com/lingui/js-lingui/compare/v4.12.0...v4.13.0) (2024-10-15)

### Features

- adds custom prefix support for gettext po ([#2004](https://github.com/lingui/js-lingui/issues/2004)) ([25b3bc6](https://github.com/lingui/js-lingui/commit/25b3bc60b6b793cd0ef15c25f760de9fef7a6750))

# [4.12.0](https://github.com/lingui/js-lingui/compare/v4.11.4...v4.12.0) (2024-10-11)

### Bug Fixes

- unicode parsing ([#2030](https://github.com/lingui/js-lingui/issues/2030)) ([0ac26cc](https://github.com/lingui/js-lingui/commit/0ac26ccf6c0fce7a25950f5643e2d9937dd0b031))

### Features

- add metro transformer ([#1999](https://github.com/lingui/js-lingui/issues/1999)) ([cc7fe27](https://github.com/lingui/js-lingui/commit/cc7fe2744495e69984bf6839e217cb4216f004ce))
- enable importAttributes and explicitResourceManagement for extractor ([#2009](https://github.com/lingui/js-lingui/issues/2009)) ([c20ce12](https://github.com/lingui/js-lingui/commit/c20ce12dbc3edaf476fd745df7e8f8b1390afe95))

## [4.11.4](https://github.com/lingui/js-lingui/compare/v4.11.3...v4.11.4) (2024-09-02)

### Bug Fixes
Expand Down
7 changes: 4 additions & 3 deletions examples/react-native/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "@formatjs/intl-locale/polyfill";
import "@formatjs/intl-locale/polyfill-force";

import "@formatjs/intl-pluralrules/polyfill";
import "@formatjs/intl-pluralrules/polyfill-force";
import "@formatjs/intl-pluralrules/locale-data/en"; // locale-data for en
import "@formatjs/intl-pluralrules/locale-data/cs"; // locale-data for cs

Expand All @@ -9,7 +9,8 @@ import { Text } from "react-native";
import { i18n } from "@lingui/core";
import { I18nProvider, TransRenderProps } from "@lingui/react";

import { messages } from "./src/locales/en/messages.js";
import { messages } from "./src/locales/en/messages.po";

import { Body } from "./src/MainScreen";

i18n.loadAndActivate({ locale: "en", messages });
Expand Down
14 changes: 13 additions & 1 deletion examples/react-native/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
// Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require("expo/metro-config");

module.exports = getDefaultConfig(__dirname);
const config = getDefaultConfig(__dirname);
const { transformer, resolver } = config;

config.transformer = {
...transformer,
babelTransformerPath: require.resolve("@lingui/metro-transformer/expo"),
};
config.resolver = {
...resolver,
sourceExts: [...resolver.sourceExts, "po", "pot"],
};

module.exports = config;
30 changes: 16 additions & 14 deletions examples/react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,36 @@
"web": "expo start --web",
"extract": "lingui extract",
"compile": "lingui compile",
"no-dev": "npx expo start --no-dev --minify",
"no-dev": "npx expo start -c --no-dev --minify",
"inspectBundle": "npx react-native-bundle-visualizer",
"fix-deps": "npx expo install --check"
},
"dependencies": {
"@formatjs/intl-locale": "^3.1.1",
"@formatjs/intl-pluralrules": "^5.1.10",
"@lingui/core": "^4.1.2",
"@lingui/react": "^4.1.2",
"expo": "49.0.0-beta.5",
"expo-status-bar": "~1.6.0",
"expo-updates": "~0.18.7",
"@formatjs/intl-locale": "^4.0.2",
"@formatjs/intl-pluralrules": "^5.2.16",
"@lingui/core": "^4.12.0",
"@lingui/react": "^4.12.0",
"expo": "~51.0.37",
"expo-status-bar": "~1.12.1",
"expo-updates": "~0.25.27",
"react": "18.2.0",
"react-native": "0.72.0",
"react-native-web": "~0.19.6"
"react-native": "0.74.5",
"react-native-web": "~0.19.10"
},
"devDependencies": {
"@babel/core": "^7.21.0",
"@lingui/cli": "^4.1.2",
"@babel/core": "^7.24.0",
"@lingui/cli": "^4.12.0",
"@lingui/macro": "^4.12.0",
"@lingui/metro-transformer": "^4.12.0",
"@react-native-community/eslint-config": "^3.2.0",
"@types/react": "~18.0.14",
"@types/react": "~18.2.79",
"@typescript-eslint/eslint-plugin": "^5.59.11",
"babel-plugin-macros": "^3.1.0",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-ft-flow": "^2.0.3",
"prettier": "^2.8.8",
"typescript": "^4.9.4"
"typescript": "~5.3.3"
},
"private": true
}
4 changes: 2 additions & 2 deletions examples/react-native/src/MainScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ export const Body = React.memo(() => {
const newActiveLanguage = activeLanguage === "en" ? "cs" : "en";
const catalog =
newActiveLanguage === "en"
? require("./locales/en/messages.js")
: require("./locales/cs/messages.js");
? require("./locales/en/messages.po")
: require("./locales/cs/messages.po");
i18n.load(newActiveLanguage, catalog.messages);
i18n.activate(newActiveLanguage);
};
Expand Down
1 change: 0 additions & 1 deletion examples/react-native/src/locales/cs/messages.js

This file was deleted.

15 changes: 7 additions & 8 deletions examples/react-native/src/locales/cs/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ msgstr ""
"X-Crowdin-File: messages.po\n"
"X-Crowdin-File-ID: 25\n"

#: src/MainScreen.tsx:102
#: src/MainScreen.tsx:91
msgid "{messageIndex, selectordinal, one {#st message} two {#nd message} few {#rd message} other {#th message}}"
msgstr "{messageIndex, selectordinal, other {#. zpráva}}"

#: src/MainScreen.tsx:89
#: src/MainScreen.tsx:78
msgid "{messagesCount, plural, =0 {You have no unread messages} one {There's # message in your inbox} few {There're # messages in your inbox} other {There're # messages in your inbox}}"
msgstr "{messagesCount, plural, =0 {Nemáte žádné nepřečtené zprávy} one {Ve vaší schránce je # zpráva} few {Ve vaší schránce jsou # zprávy} many {Ve vaší schránce je # zpráv} other {Ve vaší schránce je # zpráv}}"

#: src/MainScreen.tsx:87
#: src/MainScreen.tsx:76
msgid "Add a message to your inbox"
msgstr "Přidat zprávu do doručené pošty"

Expand All @@ -38,23 +38,22 @@ msgstr "Zrušit"
msgid "Do you want to set all your messages as read?"
msgstr "Chcete označit všechny vaše zprávy jako přečtené?"

#: src/MainScreen.tsx:86
#: src/MainScreen.tsx:75
msgid "Mark messages as read"
msgstr "Označit zprávy jako přečtené"

#: src/MainScreen.tsx:83
#: src/MainScreen.tsx:73
msgid "Message Inbox"
msgstr "Doručená pošta"

#: src/MainScreen.tsx:101
#: src/MainScreen.tsx:90
msgid "order:"
msgstr "pořadí:"

#: src/MainScreen.tsx:43
#: src/MainScreen.tsx:44
msgid "Toggle language to {0}"
msgstr "Přepnout jazyk na {0}"

#: src/MainScreen.tsx:17
msgid "Yes"
msgstr "Ano"

1 change: 0 additions & 1 deletion examples/react-native/src/locales/en/messages.js

This file was deleted.

14 changes: 7 additions & 7 deletions examples/react-native/src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ msgstr ""
"Language-Team: \n"
"Plural-Forms: \n"

#: src/MainScreen.tsx:102
#: src/MainScreen.tsx:91
msgid "{messageIndex, selectordinal, one {#st message} two {#nd message} few {#rd message} other {#th message}}"
msgstr "{messageIndex, selectordinal, one {#st message} two {#nd message} few {#rd message} other {#th message}}"

#: src/MainScreen.tsx:89
#: src/MainScreen.tsx:78
msgid "{messagesCount, plural, =0 {You have no unread messages} one {There's # message in your inbox} few {There're # messages in your inbox} other {There're # messages in your inbox}}"
msgstr "{messagesCount, plural, =0 {You have no unread messages} one {There's # message in your inbox} few {There're # messages in your inbox} other {There're # messages in your inbox}}"

#: src/MainScreen.tsx:87
#: src/MainScreen.tsx:76
msgid "Add a message to your inbox"
msgstr "Add a message to your inbox"

Expand All @@ -33,19 +33,19 @@ msgstr "Cancel"
msgid "Do you want to set all your messages as read?"
msgstr "Do you want to set all your messages as read?"

#: src/MainScreen.tsx:86
#: src/MainScreen.tsx:75
msgid "Mark messages as read"
msgstr "Mark messages as read"

#: src/MainScreen.tsx:83
#: src/MainScreen.tsx:73
msgid "Message Inbox"
msgstr "Message Inbox"

#: src/MainScreen.tsx:101
#: src/MainScreen.tsx:90
msgid "order:"
msgstr "order:"

#: src/MainScreen.tsx:43
#: src/MainScreen.tsx:44
msgid "Toggle language to {0}"
msgstr "Toggle language to {0}"

Expand Down
4 changes: 4 additions & 0 deletions examples/react-native/src/po-types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare module "*.po" {
import type { Messages } from "@lingui/core";
export const messages: Messages;
}
Loading

0 comments on commit fd17843

Please sign in to comment.