index int64 0 0 | repo_id stringlengths 16 181 | file_path stringlengths 28 270 | content stringlengths 1 11.6M | __index_level_0__ int64 0 10k |
|---|---|---|---|---|
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/js/package.json | {
"name": "vanilla-js",
"version": "1.0.0",
"main": "src/index.js",
"license": "MIT",
"author": {
"name": "Tomáš Ehrlich",
"email": "tomas.ehrlich@gmail.com"
},
"scripts": {
"test": "lingui compile && jest src",
"extract": "lingui extract --clean"
},
"dependencies": {
"@lingui/core... | 4,700 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/js/yarn.lock | # This file is generated by running "yarn install" inside your project.
# Manual changes might be lost - proceed with caution!
__metadata:
version: 6
cacheKey: 8
"@ampproject/remapping@npm:^2.2.0":
version: 2.2.0
resolution: "@ampproject/remapping@npm:2.2.0"
dependencies:
"@jridgewell/gen-mapping": ^0.1... | 4,701 |
0 | petrpan-code/lingui/js-lingui/examples/js | petrpan-code/lingui/js-lingui/examples/js/src/ids.js | import { i18n } from "@lingui/core"
import { t, plural, defineMessage } from "@lingui/macro"
i18n.load({
en: require("./locale/en/messages").messages,
cs: require("./locale/cs/messages").messages,
})
export const common = {
yes: defineMessage({
id: "common.yes",
comment: "Agreement",
message: "Yes",... | 4,702 |
0 | petrpan-code/lingui/js-lingui/examples/js | petrpan-code/lingui/js-lingui/examples/js/src/messages.js | import { i18n } from "@lingui/core"
import { t, plural, defineMessage } from "@lingui/macro"
i18n.load({
en: require("./locale/en/messages").messages,
cs: require("./locale/cs/messages").messages,
})
/**
* Example: Lazy messages - common phrases are only defined, but not translated.
*/
export const common = {
... | 4,703 |
0 | petrpan-code/lingui/js-lingui/examples/js | petrpan-code/lingui/js-lingui/examples/js/src/test.js | import { i18n } from "@lingui/core"
describe("vanilla-js example", function () {
describe("messages as ids", function () {
test(require("./messages"))
})
describe("custom ids", function () {
test(require("./ids"))
})
})
function test({ getStatic, getVariables, getPlural, getLazy }) {
it("should tra... | 4,704 |
0 | petrpan-code/lingui/js-lingui/examples/js/src/locale | petrpan-code/lingui/js-lingui/examples/js/src/locale/cs/messages.js | /*eslint-disable*/module.exports={messages:JSON.parse("{\"static\":\"Ukázka @lingui/core\",\"zziTz4\":\"Ukázka @lingui/core\",\"lazy\":[\"Chcete pokračovat? \",[\"yes\"],\"/\",[\"no\"]],\"+GYOc0\":[\"Chcete pokračovat? \",[\"yes\"],\"/\",[\"no\"]],\"variables\":[\"Ahoj \",[\"name\"]],\"OVaF9k\":[\"Ahoj \",[\"name\"]],\... | 4,705 |
0 | petrpan-code/lingui/js-lingui/examples/js/src/locale | petrpan-code/lingui/js-lingui/examples/js/src/locale/cs/messages.po | msgid ""
msgstr ""
"POT-Creation-Date: 2018-09-09 19:21+0200\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: @lingui/cli\n"
"Language: cs\n"
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-T... | 4,706 |
0 | petrpan-code/lingui/js-lingui/examples/js/src/locale | petrpan-code/lingui/js-lingui/examples/js/src/locale/en/messages.js | /*eslint-disable*/module.exports={messages:JSON.parse("{\"static\":\"@lingui/core example\",\"zziTz4\":\"@lingui/core example\",\"lazy\":[\"Do you want to proceed? \",[\"yes\"],\"/\",[\"no\"]],\"+GYOc0\":[\"Do you want to proceed? \",[\"yes\"],\"/\",[\"no\"]],\"variables\":[\"Hello \",[\"name\"]],\"OVaF9k\":[\"Hello \"... | 4,707 |
0 | petrpan-code/lingui/js-lingui/examples/js/src/locale | petrpan-code/lingui/js-lingui/examples/js/src/locale/en/messages.po | msgid ""
msgstr ""
"POT-Creation-Date: 2018-09-09 19:21+0200\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: @lingui/cli\n"
"Language: en\n"
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-T... | 4,708 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/nextjs-babel/.babelrc | {
"presets": [
"next/babel"
],
"plugins": ["macros"]
}
| 4,709 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/nextjs-babel/README.md | This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
## Getting Started
First, run the development server:
```bash
npm run dev
# or
yarn dev
```
Open [http://localhost:3000](http://localhost:3000) with your br... | 4,710 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/nextjs-babel/lingui.config.js | const nextConfig = require("./next.config")
/** @type {import('@lingui/conf').LinguiConfig} */
module.exports = {
locales: nextConfig.i18n.locales,
pseudoLocale: "pseudo",
sourceLocale: nextConfig.i18n.defaultLocale,
fallbackLocales: {
default: "en",
},
catalogs: [
{
path: "src/locales/{local... | 4,711 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/nextjs-babel/next-env.d.ts | /// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
| 4,712 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/nextjs-babel/next.config.js | /** @type {import('next').NextConfig} */
module.exports = {
i18n: {
// These are all the locales you want to support in
// your application
locales: ["en", "cs", "pseudo"],
defaultLocale: "en",
},
}
| 4,713 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/nextjs-babel/package.json | {
"name": "next-js-babel",
"version": "0.1.0",
"private": true,
"scripts": {
"extract": "lingui extract",
"dev": "next dev",
"build": "yarn extract && next build",
"start": "next start"
},
"dependencies": {
"@lingui/core": "^4.1.2",
"@lingui/react": "^4.1.2",
"classnames": "^2.3.... | 4,714 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/nextjs-babel/tsconfig.json | {
"compilerOptions": {
"baseUrl": ".",
"target": "ESNext",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esn... | 4,715 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/nextjs-babel/yarn.lock | # This file is generated by running "yarn install" inside your project.
# Manual changes might be lost - proceed with caution!
__metadata:
version: 6
cacheKey: 8
"@ampproject/remapping@npm:^2.2.0":
version: 2.2.0
resolution: "@ampproject/remapping@npm:2.2.0"
dependencies:
"@jridgewell/gen-mapping": ^0.1... | 4,716 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-babel | petrpan-code/lingui/js-lingui/examples/nextjs-babel/public/vercel.svg | <svg width="283" height="64" viewBox="0 0 283 64" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path d="M141.04 16c-11.04 0-19 7.2-19 18s8.96 18 20 18c6.67 0 12.55-2.64 16.19-7.09l-7.65-4.42c-2.02 2.21-5.09 3.5-8.54 3.5-4.79 0-8.86-2.5-10.37-6.5h28.02c.22-1.12.35-2.28.35-3.5 0-10.79-7.96-17.99-19-17.99zm-9.... | 4,717 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-babel | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src/i18n.ts | import { i18n, Messages } from "@lingui/core"
import { useRouter } from "next/router"
import { useEffect } from "react"
/**
* Load messages for requested locale and activate it.
* This function isn't part of the LinguiJS library because there are
* many ways how to load messages — from REST API, from file, from cac... | 4,718 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-babel | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src/styles.css | html,
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}
a {
color: inherit;
text-decoration: none;
}
* {
box-sizing: border-box;
}
| 4,719 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src/components/Layout.module.css | .container {
min-height: 100vh;
max-width: 960px;
width: 100%;
padding: 0 0.5rem;
margin: 0 auto;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.main {
flex: 1;
}
.footer {
width: 100%;
height: 100px;
border-top: 1px solid #eaeaea;
display: flex;
... | 4,720 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src/components/Layout.tsx | import Head from "next/head"
import classnames from "classnames"
import { t, Trans } from "@lingui/macro"
import styles from "./Layout.module.css"
import { useLingui } from "@lingui/react"
import { useRouter } from "next/router"
export function Layout({ title = null, className = "", children }) {
/**
* This hoo... | 4,721 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src/components/PluralExample.tsx | import React from "react"
export function PluralExample({ initialValue = 1, render }) {
const [value, setValue] = React.useState(initialValue)
return (
<div>
<div>{render({ value })}</div>
<div>
<input
value={value}
type="number"
onChange={(e) => setValue(e.ta... | 4,722 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src/locales/cs.po | msgid ""
msgstr ""
"POT-Creation-Date: 2020-04-04 12:09+0200\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: @lingui/cli\n"
"Language: cs\n"
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-T... | 4,723 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src/locales/en.po | msgid ""
msgstr ""
"POT-Creation-Date: 2020-04-04 13:38+0200\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: @lingui/cli\n"
"Language: en\n"
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-T... | 4,724 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src/locales/pseudo.po | msgid ""
msgstr ""
"POT-Creation-Date: 2023-03-22 13:03+0100\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: @lingui/cli\n"
"Language: pseudo\n"
#: src/pages/examples.tsx:36
#: src/pages/examples.tsx:48
msgid "{value, plural, one {There's one book}... | 4,725 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src/pages/_app.tsx | import { I18nProvider } from "@lingui/react"
import { i18n } from "@lingui/core"
import "../styles.css"
import { useLinguiInit } from "../i18n"
import { AppProps } from "next/app"
export default function MyApp({ Component, pageProps }: AppProps) {
useLinguiInit(pageProps.translation)
return (
<>
<I18nP... | 4,726 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src/pages/examples.tsx | import { Trans, Plural, plural, msg } from "@lingui/macro"
import { Layout } from "../components/Layout"
import { PluralExample } from "../components/PluralExample"
import { GetStaticProps } from "next"
import { loadCatalog } from "../i18n"
import { useLingui } from "@lingui/react"
export const getStaticProps: GetSta... | 4,727 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src/pages/index.module.css | .main {
padding: 5rem 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.title a {
color: #0070f3;
text-decoration: none;
}
.title a:hover,
.title a:focus,
.title a:active {
text-decoration: underline;
}
.title {
margin: 0;
line-height: 1.15;
font-size: 4... | 4,728 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src/pages/index.tsx | import Link from "next/link"
import { Trans } from "@lingui/macro"
import { Layout } from "../components/Layout"
import styles from "./index.module.css"
import { GetStaticProps } from "next"
import { loadCatalog } from "../i18n"
export const getStaticProps: GetStaticProps = async (ctx) => {
const translation = awa... | 4,729 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src/pages | petrpan-code/lingui/js-lingui/examples/nextjs-babel/src/pages/api/hello.ts | // Next.js API route support: https://nextjs.org/docs/api-routes/introduction
export default (req, res) => {
res.statusCode = 200
res.json({ name: 'John Doe' })
}
| 4,730 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/nextjs-swc/.eslintrc.json | {
"extends": "next/core-web-vitals"
}
| 4,731 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/nextjs-swc/.prettierrc.js | module.exports = {
semi: false,
singleQuote: true,
trailingComma: 'none'
// endOfLine: "lf"
}
| 4,732 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/nextjs-swc/README.md | ## Example project using Next 13 SWC Compiler with LinguiJS Plugin
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
## SWC Compatibility
SWC Plugin support is still experimental. Semver backwards compatibili... | 4,733 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/nextjs-swc/lingui.config.js | const nextConfig = require('./next.config')
/** @type {import('@lingui/conf').LinguiConfig} */
module.exports = {
locales: nextConfig.i18n.locales,
pseudoLocale: 'pseudo',
sourceLocale: nextConfig.i18n.defaultLocale,
fallbackLocales: {
default: 'en'
},
catalogs: [
{
path: 'src/locales/{locale... | 4,734 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/nextjs-swc/next-env.d.ts | /// <reference types="next" />
/// <reference types="next/image-types/global" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
| 4,735 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/nextjs-swc/next.config.js | /** @type {import('next').NextConfig} */
module.exports = {
i18n: {
// These are all the locales you want to support in
// your application
locales: ['en', 'sr', 'es', 'pseudo'],
defaultLocale: 'en'
},
experimental: {
swcPlugins: [
['@lingui/swc-plugin', {}],
],
},
}
| 4,736 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/nextjs-swc/package.json | {
"name": "nextjs-swc-example",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"debug": "NODE_OPTIONS='--inspect' next dev",
"build": "yarn lang:extract && next build",
"start": "next start",
"lingui:extract": "lingui extract --clean",
"test": "yarn build"
},
"d... | 4,737 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/nextjs-swc/tsconfig.json | {
"compilerOptions": {
"target": "es6",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolut... | 4,738 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/nextjs-swc/yarn.lock | # This file is generated by running "yarn install" inside your project.
# Manual changes might be lost - proceed with caution!
__metadata:
version: 6
cacheKey: 8
"@ampproject/remapping@npm:^2.2.0":
version: 2.2.0
resolution: "@ampproject/remapping@npm:2.2.0"
dependencies:
"@jridgewell/gen-mapping": ^0.1... | 4,739 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-swc | petrpan-code/lingui/js-lingui/examples/nextjs-swc/public/vercel.svg | <svg width="283" height="64" viewBox="0 0 283 64" fill="none"
xmlns="http://www.w3.org/2000/svg">
<path d="M141.04 16c-11.04 0-19 7.2-19 18s8.96 18 20 18c6.67 0 12.55-2.64 16.19-7.09l-7.65-4.42c-2.02 2.21-5.09 3.5-8.54 3.5-4.79 0-8.86-2.5-10.37-6.5h28.02c.22-1.12.35-2.28.35-3.5 0-10.79-7.96-17.99-19-17.99zm-9.4... | 4,740 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-swc | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src/utils.ts | import { i18n, Messages } from '@lingui/core'
import { useRouter } from 'next/router'
import { useEffect } from 'react'
export async function loadCatalog(locale: string) {
const catalog = await import(`@lingui/loader!./locales/${locale}.po`)
return catalog.messages
}
export function useLinguiInit(messages: Messag... | 4,741 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src/components/AboutText.tsx | import { Trans } from '@lingui/macro'
export function AboutText() {
return (
<p>
<Trans id="next-explanation">
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 ... | 4,742 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src/components/Developers.tsx | import { useState } from 'react'
import { Trans, Plural } from '@lingui/macro'
export default function Developers() {
const [selected, setSelected] = useState('1')
return (
<div>
<p>
<Trans>Plural Test: How many developers?</Trans>
</p>
<div style={{ display: 'flex', justifyContent: '... | 4,743 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src/components/Switcher.tsx | import { useRouter } from 'next/router'
import { useState } from 'react'
import { t, msg } from '@lingui/macro'
import { MessageDescriptor } from '@lingui/core/src'
import { useLingui } from '@lingui/react'
type LOCALES = 'en' | 'sr' | 'es' | 'pseudo'
const languages: { [key: string]: MessageDescriptor } = {
en: ms... | 4,744 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src/locales/en.po | msgid ""
msgstr ""
"POT-Creation-Date: 2020-12-04 23:19+0100\n"
"Mime-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: @lingui/cli\n"
"Language: en\n"
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-T... | 4,745 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src/locales/es.po | msgid ""
msgstr ""
"POT-Creation-Date: 2020-12-05 21:42+0100\n"
"Mime-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: @lingui/cli\n"
"Language: es\n"
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-T... | 4,746 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src/locales/pseudo.po | msgid ""
msgstr ""
"POT-Creation-Date: 2020-12-21 21:28+0100\n"
"Mime-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: @lingui/cli\n"
"Language: pseudo\n"
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Langua... | 4,747 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src/locales/sr.po | msgid ""
msgstr ""
"POT-Creation-Date: 2020-12-04 23:19+0100\n"
"Mime-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: @lingui/cli\n"
"Language: sr\n"
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-T... | 4,748 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src/pages/_app.tsx | import { i18n } from '@lingui/core'
import { I18nProvider } from '@lingui/react'
import '../styles/globals.css'
import type { AppProps } from 'next/app'
import { useLinguiInit } from '../utils'
function MyApp({ Component, pageProps }: AppProps) {
useLinguiInit(pageProps.translation)
return (
<>
<I18nPro... | 4,749 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src/pages/index.tsx | import { t, Trans } from '@lingui/macro'
import { GetStaticProps, NextPage } from 'next'
import Head from 'next/head'
import { AboutText } from '../components/AboutText'
import Developers from '../components/Developers'
import { Switcher } from '../components/Switcher'
import styles from '../styles/Index.module.css'
im... | 4,750 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src/styles/Index.module.css | .container {
min-height: 100vh;
padding: 0 0.5rem;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.main {
padding: 5rem 0;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.title a {
color: #0070f3;
text... | 4,751 |
0 | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src | petrpan-code/lingui/js-lingui/examples/nextjs-swc/src/styles/globals.css | html,
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}
a {
color: inherit;
text-decoration: none;
}
* {
box-sizing: border-box;
}
| 4,752 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/react-native/.eslintrc.js | module.exports = {
root: true,
extends: ["@react-native-community"],
};
| 4,753 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/react-native/.prettierrc | {
"singleQuote": false,
"trailingComma": "all",
"tabWidth": 2,
"bracketSpacing": true,
"printWidth": 90
}
| 4,754 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/react-native/.yarnrc.yml | nodeLinker: node-modules
| 4,755 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/react-native/App.tsx | import "@formatjs/intl-locale/polyfill";
import "@formatjs/intl-pluralrules/polyfill";
import "@formatjs/intl-pluralrules/locale-data/en"; // locale-data for en
import "@formatjs/intl-pluralrules/locale-data/cs"; // locale-data for cs
import React from "react";
import { Text } from "react-native";
import { i18n } fro... | 4,756 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/react-native/README.md | ### Lingui React Native Demo App
This example app accompanies the tutorial https://lingui.dev/tutorials/react-native.
It can also be used to test out changes made in `@lingui/core` and `@lingui/react` using these steps:
Note the following instructions can be expanded for any package inside the `packages` folder.
Fo... | 4,757 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/react-native/app.json | {
"expo": {
"name": "js-lingui-demo",
"description": "This a simple demo app for lingui.js",
"slug": "js-lingui-demo",
"version": "2.0.1",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/splash.png",
"res... | 4,758 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/react-native/babel.config.js | module.exports = function (api) {
api.cache(false);
return {
plugins: ["macros"],
presets: ["babel-preset-expo"],
};
};
| 4,759 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/react-native/lingui.config.js | /** @type {import('@lingui/conf').LinguiConfig} */
module.exports = {
locales: ["en", "cs"],
sourceLocale: "en",
catalogs: [
{
path: "src/locales/{locale}/messages",
include: ["src"],
},
],
format: "po",
};
| 4,760 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/react-native/metro.config.js | // Learn more https://docs.expo.io/guides/customizing-metro
const { getDefaultConfig } = require("expo/metro-config");
module.exports = getDefaultConfig(__dirname);
| 4,761 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/react-native/package.json | {
"name": "lingui-demo",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start -c",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"extract": "lingui extract",
"compile": "lingui compile",
"no-dev": "n... | 4,762 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/react-native/tsconfig.json | {
"extends": "expo/tsconfig.base",
"compilerOptions": {
"strict": true
}
}
| 4,763 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/react-native/yarn.lock | # This file is generated by running "yarn install" inside your project.
# Manual changes might be lost - proceed with caution!
__metadata:
version: 6
cacheKey: 8
"@0no-co/graphql.web@npm:^1.0.1":
version: 1.0.1
resolution: "@0no-co/graphql.web@npm:1.0.1"
peerDependencies:
graphql: ^14.0.0 || ^15.0.0 || ... | 4,764 |
0 | petrpan-code/lingui/js-lingui/examples/react-native | petrpan-code/lingui/js-lingui/examples/react-native/src/Components.tsx | import { TextProps, Text } from "react-native";
export const Heading = (props: Omit<TextProps, "style">) => {
return (
<Text
style={{
fontSize: 20,
fontWeight: "bold",
}}
{...props}
/>
);
};
| 4,765 |
0 | petrpan-code/lingui/js-lingui/examples/react-native | petrpan-code/lingui/js-lingui/examples/react-native/src/MainScreen.tsx | import React, { useState } from "react";
import { StyleSheet, Text, View, Alert, SafeAreaView } from "react-native";
import { Plural, SelectOrdinal, t, Trans } from "@lingui/macro";
import { useLingui } from "@lingui/react";
import { Button } from "./PaddedButton";
import { Heading } from "./Components";
export const ... | 4,766 |
0 | petrpan-code/lingui/js-lingui/examples/react-native | petrpan-code/lingui/js-lingui/examples/react-native/src/PaddedButton.tsx | import {
Button as RNButton,
StyleSheet,
View,
Platform,
ButtonProps,
} from "react-native";
import React from "react";
export const Button = (props: ButtonProps) => (
<View style={styles.margin}>
<RNButton {...props} />
</View>
);
const styles = StyleSheet.create({
margin: {
...Platform.selec... | 4,767 |
0 | petrpan-code/lingui/js-lingui/examples/react-native/src/locales | petrpan-code/lingui/js-lingui/examples/react-native/src/locales/cs/messages.js | /*eslint-disable*/module.exports={messages:JSON.parse("{\"+MmZxf\":[[\"messageIndex\",\"selectordinal\",{\"other\":[\"#\",\". zpráva\"]}]],\"naPEvs\":[[\"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 \",\"#\",\"... | 4,768 |
0 | petrpan-code/lingui/js-lingui/examples/react-native/src/locales | petrpan-code/lingui/js-lingui/examples/react-native/src/locales/cs/messages.po | msgid ""
msgstr ""
"POT-Creation-Date: 2023-04-27 00:37+0200\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: @lingui/cli\n"
"Language: cs\n"
"Project-Id-Version: linguidemo\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-04-28 17:32\n"
"Last-T... | 4,769 |
0 | petrpan-code/lingui/js-lingui/examples/react-native/src/locales | petrpan-code/lingui/js-lingui/examples/react-native/src/locales/en/messages.js | /*eslint-disable*/module.exports={messages:JSON.parse("{\"+MmZxf\":[[\"messageIndex\",\"selectordinal\",{\"one\":[\"#\",\"st message\"],\"two\":[\"#\",\"nd message\"],\"few\":[\"#\",\"rd message\"],\"other\":[\"#\",\"th message\"]}]],\"naPEvs\":[[\"messagesCount\",\"plural\",{\"0\":\"You have no unread messages\",\"one... | 4,770 |
0 | petrpan-code/lingui/js-lingui/examples/react-native/src/locales | petrpan-code/lingui/js-lingui/examples/react-native/src/locales/en/messages.po | msgid ""
msgstr ""
"POT-Creation-Date: 2023-04-27 00:37+0200\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: @lingui/cli\n"
"Language: en\n"
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-T... | 4,771 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/rspack/LICENSE | MIT License
Copyright (c) 2023 Collin Brown
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, dist... | 4,772 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/rspack/README.md | # Lingui + RSpack Example
This project shows how to use the [Rspack JavaScript bundler](https://www.rspack.dev/guide/introduction.html) with [Lingui JS](https://lingui.dev/) to provide i18n for a React application (TypeScript).

## Setup Instructions
1. `cd rspack-project && npm ... | 4,773 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/rspack/index.html | <!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Rspack + React + TS</title>
</head>
<body>
<div id="root"></div>
</body>
</html> | 4,774 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/rspack/lingui.config.ts | import { LinguiConfig } from '@lingui/conf'
const config: Partial<LinguiConfig> = {
locales: ["en", "fr"],
sourceLocale: "en",
catalogs: [{
path: "src/locales/{locale}/messages",
include: ["src"]
}],
format: "po"
};
export default config; | 4,775 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/rspack/package.json | {
"name": "rspack-react-ts-starter",
"private": true,
"version": "1.0.0",
"babel": {
"plugins": [
"macros"
]
},
"scripts": {
"dev": "rspack serve",
"build": "rspack build",
"extract": "lingui extract",
"compile": "lingui compile --typescript"
},
"dependencies": {
"@babe... | 4,776 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/rspack/rspack.config.js | /**
* @type {import('@rspack/cli').Configuration}
*/
module.exports = {
context: __dirname,
entry: {
main: "./src/main.tsx"
},
builtins: {
html: [
{
template: "./index.html"
}
]
},
module: {
rules: [
{
... | 4,777 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/rspack/tsconfig.json | {
"compilerOptions": {
"target": "ES6",
"lib": [
"DOM",
"DOM.Iterable",
"ESNext"
],
"module": "ESNext",
"skipLibCheck": true,
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,... | 4,778 |
0 | petrpan-code/lingui/js-lingui/examples/rspack | petrpan-code/lingui/js-lingui/examples/rspack/src/Inbox.tsx | import React from "react";
import { useLingui } from "@lingui/react";
import { Trans, Plural } from "@lingui/macro";
import LocaleSwitcher from './LocaleSwitcher';
export default function Inbox() {
const messages = [{}, {}];
const messagesCount = messages.length;
const lastLogin = new Date();
const ... | 4,779 |
0 | petrpan-code/lingui/js-lingui/examples/rspack | petrpan-code/lingui/js-lingui/examples/rspack/src/LocaleSwitcher.tsx | import React from 'react';
import { useLingui } from '@lingui/react';
import Locale from './locales';
function LocaleSwitcher() {
const { i18n } = useLingui();
const handleLocaleChange = (newLocale: Locale) => {
i18n.activate(newLocale);
};
return (
<div>
<button onClick={... | 4,780 |
0 | petrpan-code/lingui/js-lingui/examples/rspack | petrpan-code/lingui/js-lingui/examples/rspack/src/index.css | :root {
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 24px;
font-weight: 400;
color-scheme: light dark;
color: rgba(255, 255, 255, 0.87);
background-color: #242424;
font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialias... | 4,781 |
0 | petrpan-code/lingui/js-lingui/examples/rspack | petrpan-code/lingui/js-lingui/examples/rspack/src/locales.ts | enum Locale {
ENGLISH = 'en',
FRENCH = 'fr',
}
export default Locale;
| 4,782 |
0 | petrpan-code/lingui/js-lingui/examples/rspack | petrpan-code/lingui/js-lingui/examples/rspack/src/main.tsx | import React from "react";
import { createRoot } from "react-dom/client";
import { i18n } from "@lingui/core";
import { I18nProvider } from "@lingui/react";
import { messages as enMessages } from "./locales/en/messages";
import { messages as frMessages } from "./locales/fr/messages";
import Inbox from "./Inbox";
i18... | 4,783 |
0 | petrpan-code/lingui/js-lingui/examples/rspack | petrpan-code/lingui/js-lingui/examples/rspack/src/react-env.d.ts | // CSS modules
type CSSModuleClasses = { readonly [key: string]: string };
declare module "*.module.css" {
const classes: CSSModuleClasses;
export default classes;
}
declare module "*.module.scss" {
const classes: CSSModuleClasses;
export default classes;
}
declare module "*.module.sass" {
const cl... | 4,784 |
0 | petrpan-code/lingui/js-lingui/examples/rspack/src | petrpan-code/lingui/js-lingui/examples/rspack/src/assets/react.svg | <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="35.93" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 228"><path fill="#00D8FF" d="M210.483 73.824a171.49 171.49 0 0 0-8.24-2.597c.465-1.9.893-3.777 1.... | 4,785 |
0 | petrpan-code/lingui/js-lingui/examples/rspack/src/locales | petrpan-code/lingui/js-lingui/examples/rspack/src/locales/en/messages.d.ts | import { Messages } from '@lingui/core';
declare const messages: Messages;
export { messages };
| 4,786 |
0 | petrpan-code/lingui/js-lingui/examples/rspack/src/locales | petrpan-code/lingui/js-lingui/examples/rspack/src/locales/en/messages.po | msgid ""
msgstr ""
"POT-Creation-Date: 2023-08-23 14:57-0400\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: @lingui/cli\n"
"Language: en\n"
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-T... | 4,787 |
0 | petrpan-code/lingui/js-lingui/examples/rspack/src/locales | petrpan-code/lingui/js-lingui/examples/rspack/src/locales/en/messages.ts | /*eslint-disable*/export const messages=JSON.parse("{\"iHvPFN\":[[\"messagesCount\",\"plural\",{\"one\":[\"There's \",\"#\",\" message in your inbox.\"],\"other\":[\"There are \",\"#\",\" messages in your inbox.\"]}]],\"ItXLVU\":[\"Last login on \",[\"0\"],\".\"],\"8bWV5m\":\"Message Inbox\",\"f8BUjV\":\"See all <0>unr... | 4,788 |
0 | petrpan-code/lingui/js-lingui/examples/rspack/src/locales | petrpan-code/lingui/js-lingui/examples/rspack/src/locales/fr/messages.d.ts | import { Messages } from '@lingui/core';
declare const messages: Messages;
export { messages };
| 4,789 |
0 | petrpan-code/lingui/js-lingui/examples/rspack/src/locales | petrpan-code/lingui/js-lingui/examples/rspack/src/locales/fr/messages.po | msgid ""
msgstr ""
"POT-Creation-Date: 2023-08-23 14:57-0400\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: @lingui/cli\n"
"Language: fr\n"
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-T... | 4,790 |
0 | petrpan-code/lingui/js-lingui/examples/rspack/src/locales | petrpan-code/lingui/js-lingui/examples/rspack/src/locales/fr/messages.ts | /*eslint-disable*/export const messages=JSON.parse("{\"iHvPFN\":[[\"messagesCount\",\"plural\",{\"one\":[\"Il y a \",\"#\",\" message dans boîte de réception.\"],\"other\":[\"Il y a \",\"#\",\" messages dans votre boîte de réception.\"]}]],\"ItXLVU\":[\"Last login on \",[\"0\"],\".\"],\"8bWV5m\":\"Boîte de réception de... | 4,791 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/vite-project-react-babel/index.html | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" sr... | 4,792 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/vite-project-react-babel/lingui.config.ts | import type { LinguiConfig } from "@lingui/conf"
const config: LinguiConfig = {
locales: ["en", "pl"],
catalogs: [
{
path: "src/locales/{locale}",
include: ["src"],
},
],
}
export default config
| 4,793 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/vite-project-react-babel/package.json | {
"name": "vite-project",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"messages:extract": "lingui extract",
"preview": "vite preview"
},
"dependencies": {
"@lingui/macro": "^4.1.2",
"@lingui/react": "^4.1.2",
... | 4,794 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/vite-project-react-babel/tsconfig.json | {
"compilerOptions": {
"target": "ESNext",
"useDefineForClassFields": true,
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"allowJs": false,
"skipLibCheck": true,
"esModuleInterop": false,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
... | 4,795 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/vite-project-react-babel/tsconfig.node.json | {
"compilerOptions": {
"composite": true,
"module": "ESNext",
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}
| 4,796 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/vite-project-react-babel/vite.config.ts | import { defineConfig } from "vite"
import react from "@vitejs/plugin-react"
import { lingui } from "@lingui/vite-plugin"
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
react({
babel: {
plugins: ["macros"],
},
}),
lingui(),
],
})
| 4,797 |
0 | petrpan-code/lingui/js-lingui/examples | petrpan-code/lingui/js-lingui/examples/vite-project-react-babel/yarn.lock | # This file is generated by running "yarn install" inside your project.
# Manual changes might be lost - proceed with caution!
__metadata:
version: 6
cacheKey: 8
"@ampproject/remapping@npm:^2.2.0":
version: 2.2.0
resolution: "@ampproject/remapping@npm:2.2.0"
dependencies:
"@jridgewell/gen-mapping": ^0.1... | 4,798 |
0 | petrpan-code/lingui/js-lingui/examples/vite-project-react-babel | petrpan-code/lingui/js-lingui/examples/vite-project-react-babel/public/vite.svg | <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%... | 4,799 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.