Skip to content

Commit

Permalink
chore: test for enum
Browse files Browse the repository at this point in the history
  • Loading branch information
yunsii committed Mar 21, 2024
1 parent 0949ea4 commit fcc1816
Show file tree
Hide file tree
Showing 6 changed files with 161 additions and 38 deletions.
4 changes: 4 additions & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export enum Test {
Foo = 'foo',
Bar = 'bar bar'
}
47 changes: 38 additions & 9 deletions src/locales/src/pages/index.page/en.po
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,53 @@ msgstr ""
"Language-Team: \n"
"Plural-Forms: \n"

#: src/pages/index.page.tsx:87
#: src/pages/index.page.tsx:89
#: src/pages/index.page.tsx:90
#: src/pages/index.page.tsx:92
msgid "{0, plural, one {# Person} other {# Persons}}"
msgstr "{0, plural, one {# Person} other {# Persons}}"

#: src/pages/index.page.tsx:66
#: src/pages/index.page.tsx:53
#~ msgid "{foo} Hello"
#~ msgstr "{foo} Hello"

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

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

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

#: src/pages/index.page.tsx:62
#: src/pages/index.page.tsx:64
#: src/pages/index.page.tsx:54
msgid "Hello {bar bar}"
msgstr "Hello {bar bar}"

#: src/pages/index.page.tsx:53
msgid "Hello {foo}"
msgstr "Hello {foo}"

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

#. 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:65
#: src/pages/index.page.tsx:67
msgid "Plain text"
msgstr "Plain text"

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

#: src/components/Switcher.tsx:11
msgid "Serbian"
msgstr "Serbian"
Expand All @@ -39,18 +68,18 @@ msgstr "Serbian"
msgid "Spanish"
msgstr "Spanish"

#: src/pages/index.page.tsx:50
#: src/pages/index.page.tsx:51
msgid "Translation Demo"
msgstr "Translation Demo"

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

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

#: src/pages/index.page.tsx:76
#: src/pages/index.page.tsx:79
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."
47 changes: 38 additions & 9 deletions src/locales/src/pages/index.page/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,53 @@ msgstr ""
"Language-Team: \n"
"Plural-Forms: \n"

#: src/pages/index.page.tsx:87
#: src/pages/index.page.tsx:89
#: src/pages/index.page.tsx:90
#: src/pages/index.page.tsx:92
msgid "{0, plural, one {# Person} other {# Persons}}"
msgstr "{0, plural, one {# ES Person} other {# ES Persons}}"

#: src/pages/index.page.tsx:66
#: src/pages/index.page.tsx:53
#~ msgid "{foo} Hello"
#~ msgstr ""

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

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

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

#: src/pages/index.page.tsx:62
#: src/pages/index.page.tsx:64
#: src/pages/index.page.tsx:54
msgid "Hello {bar bar}"
msgstr ""

#: src/pages/index.page.tsx:53
msgid "Hello {foo}"
msgstr ""

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

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

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

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

#: src/components/Switcher.tsx:11
msgid "Serbian"
msgstr "ES Serbian"
Expand All @@ -39,18 +68,18 @@ msgstr "ES Serbian"
msgid "Spanish"
msgstr "ES Spanish"

#: src/pages/index.page.tsx:50
#: src/pages/index.page.tsx:51
msgid "Translation Demo"
msgstr "ES Translation Demo"

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

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

#: src/pages/index.page.tsx:76
#: src/pages/index.page.tsx:79
msgid "Wonderful framework <0>Next.js</0>say hi. And <1>Next.js</1>say hi."
msgstr "ES Wonderful framework <0>Next.js</0>say hi. And <1>Next.js</1>say hi."
47 changes: 38 additions & 9 deletions src/locales/src/pages/index.page/pseudo.po
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,53 @@ msgstr ""
"Language-Team: \n"
"Plural-Forms: \n"

#: src/pages/index.page.tsx:87
#: src/pages/index.page.tsx:89
#: src/pages/index.page.tsx:90
#: src/pages/index.page.tsx:92
msgid "{0, plural, one {# Person} other {# Persons}}"
msgstr ""

#: src/pages/index.page.tsx:66
#: src/pages/index.page.tsx:53
#~ msgid "{foo} Hello"
#~ msgstr ""

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

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

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

#: src/pages/index.page.tsx:62
#: src/pages/index.page.tsx:64
#: src/pages/index.page.tsx:54
msgid "Hello {bar bar}"
msgstr ""

#: src/pages/index.page.tsx:53
msgid "Hello {foo}"
msgstr ""

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

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

#: src/pages/index.page.tsx:65
#: src/pages/index.page.tsx:67
msgid "Plain text"
msgstr ""

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

#: src/components/Switcher.tsx:11
msgid "Serbian"
msgstr ""
Expand All @@ -39,18 +68,18 @@ msgstr ""
msgid "Spanish"
msgstr ""

#: src/pages/index.page.tsx:50
#: src/pages/index.page.tsx:51
msgid "Translation Demo"
msgstr ""

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

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

#: src/pages/index.page.tsx:76
#: src/pages/index.page.tsx:79
msgid "Wonderful framework <0>Next.js</0>say hi. And <1>Next.js</1>say hi."
msgstr ""
47 changes: 38 additions & 9 deletions src/locales/src/pages/index.page/sr.po
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,53 @@ msgstr ""
"Language-Team: \n"
"Plural-Forms: \n"

#: src/pages/index.page.tsx:87
#: src/pages/index.page.tsx:89
#: src/pages/index.page.tsx:90
#: src/pages/index.page.tsx:92
msgid "{0, plural, one {# Person} other {# Persons}}"
msgstr ""

#: src/pages/index.page.tsx:66
#: src/pages/index.page.tsx:53
#~ msgid "{foo} Hello"
#~ msgstr ""

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

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

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

#: src/pages/index.page.tsx:62
#: src/pages/index.page.tsx:64
#: src/pages/index.page.tsx:54
msgid "Hello {bar bar}"
msgstr ""

#: src/pages/index.page.tsx:53
msgid "Hello {foo}"
msgstr ""

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

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

#: src/pages/index.page.tsx:65
#: src/pages/index.page.tsx:67
msgid "Plain text"
msgstr ""

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

#: src/components/Switcher.tsx:11
msgid "Serbian"
msgstr ""
Expand All @@ -39,18 +68,18 @@ msgstr ""
msgid "Spanish"
msgstr ""

#: src/pages/index.page.tsx:50
#: src/pages/index.page.tsx:51
msgid "Translation Demo"
msgstr ""

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

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

#: src/pages/index.page.tsx:76
#: src/pages/index.page.tsx:79
msgid "Wonderful framework <0>Next.js</0>say hi. And <1>Next.js</1>say hi."
msgstr ""
7 changes: 5 additions & 2 deletions src/pages/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import styles from '../styles/Index.module.css'
import { loadCatalog } from '../utils'
import { useLingui } from '@lingui/react'
import { curringFoo } from '../helpers/currying'
import { Test } from '../constants'

export const getStaticProps: GetStaticProps = async (ctx) => {
const fileName = __filename
Expand All @@ -36,8 +37,8 @@ const Index: NextPage = () => {
*/
useLingui()

const result = curringFoo()()
console.log('curringFoo', result)
const result = curringFoo()
console.log('curringFoo', result())

return (
<div className={styles.container}>
Expand All @@ -49,6 +50,8 @@ const Index: NextPage = () => {
*/}
<title>{t`Translation Demo`}</title>
<link rel="icon" href="/favicon.ico" />
<div>{t`Hello ${Test.Foo}`}</div>
<div>{t`Hello ${Test.Bar}`}</div>
</Head>

<main className={styles.main}>
Expand Down

0 comments on commit fcc1816

Please sign in to comment.