Skip to content

Commit

Permalink
chore: use babel plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
yunsii committed Jul 9, 2024
1 parent e83d8b1 commit d6b0a19
Show file tree
Hide file tree
Showing 9 changed files with 100 additions and 72 deletions.
4 changes: 4 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["next/babel"],
"plugins": ["macros"]
}
8 changes: 4 additions & 4 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ module.exports = {
locales: ['en', 'sr', 'es', 'pseudo'],
defaultLocale: 'en'
},
pageExtensions: ['page.tsx'],
experimental: {
swcPlugins: [['@lingui/swc-plugin', {}]]
}
pageExtensions: ['page.tsx']
// experimental: {
// swcPlugins: [['@lingui/swc-plugin', {}]]
// }
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@
"@lingui/cli": "5.0.0-next.0",
"@lingui/loader": "5.0.0-next.0",
"@lingui/macro": "5.0.0-next.0",
"@lingui/swc-plugin": "^4.0.4",
"@lingui/swc-plugin": "4.0.5",
"@types/react": "^18.0.14",
"babel-plugin-macros": "^3.1.0",
"eslint": "8.35.0",
"eslint-config-next": "12.3.4",
"typescript": "^4.7.4"
Expand Down
36 changes: 21 additions & 15 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 14 additions & 10 deletions src/locales/src/pages/index.page/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ msgstr ""

#. placeholder {0}: 1
#. placeholder {0}: 2
#: src/pages/index.page.tsx:91
#: src/pages/index.page.tsx:93
#: src/pages/index.page.tsx:92
#: src/pages/index.page.tsx:94
msgid "{0, plural, one {# Person} other {# Persons}}"
msgstr "{0, plural, one {# Person} other {# Persons}}"

#: src/components/Developers.tsx:20
msgid "{selected, plural, one {Developer} other {Developers}}"
msgstr "{selected, plural, one {Developer} other {Developers}}"

#: src/pages/index.page.tsx:70
#: src/pages/index.page.tsx:71
msgid "<0>Next.js</0> say hi."
msgstr "<0>Next.js</0> say hi."

Expand All @@ -34,22 +34,26 @@ msgstr "English"

#. placeholder {0}: "foo"
#. placeholder {0}: "bar bar"
#: src/pages/index.page.tsx:54
#: src/pages/index.page.tsx:55
#: src/pages/index.page.tsx:56
#: src/pages/index.page.tsx:57
msgid "Hello {0}"
msgstr "Hello {0}"

#: src/components/AboutText.tsx:6
msgid "Hello, world"
msgstr "Hello, world"

#: src/pages/index.page.tsx:53
msgid "Index Page Description"
msgstr "Index Page Description"

#. js-lingui-explicit-id
#: src/components/AboutText.tsx:8
msgid "message.next-explanation"
msgstr "Next.js is an open-source React front-end development web framework that enables functionality such as server-side rendering and generating static websites for React based web applications. It is a production-ready framework that allows developers to quickly create static and dynamic JAMstack websites and is used widely by many large companies."

#: src/pages/index.page.tsx:66
#: src/pages/index.page.tsx:68
#: src/pages/index.page.tsx:67
#: src/pages/index.page.tsx:69
msgid "Plain text"
msgstr "Plain text"

Expand All @@ -69,14 +73,14 @@ msgstr "Spanish"
msgid "Translation Demo"
msgstr "Translation Demo"

#: src/pages/index.page.tsx:61
#: src/pages/index.page.tsx:62
msgid "Welcome to <0>Next.js!</0>"
msgstr "Welcome to <0>Next.js!</0>"

#: src/pages/index.page.tsx:75
#: src/pages/index.page.tsx:76
msgid "Wonderful framework <0>Next.js</0> say hi."
msgstr "Wonderful framework <0>Next.js</0> say hi."

#: src/pages/index.page.tsx:80
#: src/pages/index.page.tsx:81
msgid "Wonderful framework <0>Next.js</0> say hi. And <1>Next.js</1> say hi."
msgstr "Wonderful framework <0>Next.js</0> say hi. And <1>Next.js</1> say hi."
40 changes: 22 additions & 18 deletions src/locales/src/pages/index.page/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -15,47 +15,51 @@ msgstr ""

#. placeholder {0}: 1
#. placeholder {0}: 2
#: src/pages/index.page.tsx:91
#: src/pages/index.page.tsx:93
#: src/pages/index.page.tsx:92
#: src/pages/index.page.tsx:94
msgid "{0, plural, one {# Person} other {# Persons}}"
msgstr "{0, plural, one {# ES Person} other {# ES Persons}}"

#: src/components/Developers.tsx:20
msgid "{selected, plural, one {Developer} other {Developers}}"
msgstr ""
msgstr "{selected, plural, one {ES Developer} other {ES Developers}}"

#: src/pages/index.page.tsx:70
#: src/pages/index.page.tsx:71
msgid "<0>Next.js</0> say hi."
msgstr ""
msgstr "ES <0>Next.js</0> say hi."

#: src/components/Switcher.tsx:10
msgid "English"
msgstr "ES English"

#. placeholder {0}: "foo"
#. placeholder {0}: "bar bar"
#: src/pages/index.page.tsx:54
#: src/pages/index.page.tsx:55
#: src/pages/index.page.tsx:56
#: src/pages/index.page.tsx:57
msgid "Hello {0}"
msgstr ""
msgstr "ES Hello {0}"

#: src/components/AboutText.tsx:6
msgid "Hello, world"
msgstr ""
msgstr "ES Hello, world"

#: src/pages/index.page.tsx:53
msgid "Index Page Description"
msgstr "ES Index Page Description"

#. js-lingui-explicit-id
#: src/components/AboutText.tsx:8
msgid "message.next-explanation"
msgstr ""
msgstr "ES Next.js is an open-source React front-end development web framework that enables functionality such as server-side rendering and generating static websites for React based web applications. It is a production-ready framework that allows developers to quickly create static and dynamic JAMstack websites and is used widely by many large companies."

#: src/pages/index.page.tsx:66
#: src/pages/index.page.tsx:68
#: src/pages/index.page.tsx:67
#: src/pages/index.page.tsx:69
msgid "Plain text"
msgstr "ES Plain text"

#: src/components/Developers.tsx:9
msgid "Plural Test: How many developers?"
msgstr ""
msgstr "ES Plural Test: How many developers?"

#: src/components/Switcher.tsx:11
msgid "Serbian"
Expand All @@ -69,14 +73,14 @@ msgstr "ES Spanish"
msgid "Translation Demo"
msgstr "ES Translation Demo"

#: src/pages/index.page.tsx:61
#: src/pages/index.page.tsx:62
msgid "Welcome to <0>Next.js!</0>"
msgstr "ES Welcome to <0>Next.js!</0>"

#: src/pages/index.page.tsx:75
#: src/pages/index.page.tsx:76
msgid "Wonderful framework <0>Next.js</0> say hi."
msgstr ""
msgstr "ES Wonderful framework <0>Next.js</0> say hi."

#: src/pages/index.page.tsx:80
#: src/pages/index.page.tsx:81
msgid "Wonderful framework <0>Next.js</0> say hi. And <1>Next.js</1> say hi."
msgstr ""
msgstr "ES Wonderful framework <0>Next.js</0> say hi. And <1>Next.js</1> say hi."
24 changes: 14 additions & 10 deletions src/locales/src/pages/index.page/pseudo.po
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ msgstr ""

#. placeholder {0}: 1
#. placeholder {0}: 2
#: src/pages/index.page.tsx:91
#: src/pages/index.page.tsx:93
#: src/pages/index.page.tsx:92
#: src/pages/index.page.tsx:94
msgid "{0, plural, one {# Person} other {# Persons}}"
msgstr ""

#: src/components/Developers.tsx:20
msgid "{selected, plural, one {Developer} other {Developers}}"
msgstr ""

#: src/pages/index.page.tsx:70
#: src/pages/index.page.tsx:71
msgid "<0>Next.js</0> say hi."
msgstr ""

Expand All @@ -34,22 +34,26 @@ msgstr ""

#. placeholder {0}: "foo"
#. placeholder {0}: "bar bar"
#: src/pages/index.page.tsx:54
#: src/pages/index.page.tsx:55
#: src/pages/index.page.tsx:56
#: src/pages/index.page.tsx:57
msgid "Hello {0}"
msgstr ""

#: src/components/AboutText.tsx:6
msgid "Hello, world"
msgstr ""

#: src/pages/index.page.tsx:53
msgid "Index Page Description"
msgstr ""

#. js-lingui-explicit-id
#: src/components/AboutText.tsx:8
msgid "message.next-explanation"
msgstr ""

#: src/pages/index.page.tsx:66
#: src/pages/index.page.tsx:68
#: src/pages/index.page.tsx:67
#: src/pages/index.page.tsx:69
msgid "Plain text"
msgstr ""

Expand All @@ -69,14 +73,14 @@ msgstr ""
msgid "Translation Demo"
msgstr ""

#: src/pages/index.page.tsx:61
#: src/pages/index.page.tsx:62
msgid "Welcome to <0>Next.js!</0>"
msgstr ""

#: src/pages/index.page.tsx:75
#: src/pages/index.page.tsx:76
msgid "Wonderful framework <0>Next.js</0> say hi."
msgstr ""

#: src/pages/index.page.tsx:80
#: src/pages/index.page.tsx:81
msgid "Wonderful framework <0>Next.js</0> say hi. And <1>Next.js</1> say hi."
msgstr ""
Loading

0 comments on commit d6b0a19

Please sign in to comment.