Skip to content

Commit

Permalink
fix(docs): documentation-typos (#955)
Browse files Browse the repository at this point in the history
  • Loading branch information
96RadhikaJadhav authored Jan 25, 2021
1 parent 6b08dd3 commit f73cb8c
Show file tree
Hide file tree
Showing 18 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion docs/guides/optimized-components.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ component*.
React components can be optimized to skip updates implementing
``shouldComponentUpdate``. Based on change of props and state, component
can decide to continue re-rendering or skip the update completely.
However, LinguiJS reads translations from context and there're two cases
However, LinguiJS reads translations from context and there are two cases
which must be handled to make i18n related updates reliable.

The two cases to handle are:
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/plurals.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Pluralization
*************

Plurals are essential when dealing with internationalization. LinguiJS_
uses `CLDR Plural Rules`_. In general, there're 6 plural forms (taken
uses `CLDR Plural Rules`_. In general, there are 6 plural forms (taken
from `CLDR Plurals`_ page):

- zero
Expand Down
4 changes: 2 additions & 2 deletions docs/ref/core.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ it and use it:
/**
* Load messages for requested locale and activate it.
* This function isn't part of the LinguiJS library because there're
* This function isn't part of the LinguiJS library because there are
* many ways how to load messages — from REST API, from file, from cache, etc.
*/
async function activate(locale: string) {
Expand Down Expand Up @@ -330,4 +330,4 @@ Events
change
------

Triggered **after** locale is changed or new catalog is loaded. There're no arguments.
Triggered **after** locale is changed or new catalog is loaded. There are no arguments.
4 changes: 2 additions & 2 deletions docs/tutorials/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ The message catalog will look like this:
{
"Message Inbox": "",
"See all <0>unread messages</0> or <1>mark them</1> as read.": "",
"{messagesCount, plural, one {There's {messagesCount} message in your inbox.} other {There're {messagesCount} messages in your inbox.}}": "",
"{messagesCount, plural, one {There's {messagesCount} message in your inbox.} other {There are {messagesCount} messages in your inbox.}}": "",
"Last login on {lastLogin,date}.": "",
}
Expand All @@ -62,7 +62,7 @@ This catalog is ready for translation. Let's translate it into Czech by filling
{
"Message Inbox": "Přijaté zprávy",
"See all <0>unread messages</0> or <1>mark them</1> as read.": "Zobrazit všechny <0>nepřečtené zprávy</0> nebo je <1>označit</1> jako přečtené.",
"{messagesCount, plural, one {There's {messagesCount} message in your inbox.} other {There're {messagesCount} messages in your inbox.}}": "{messagesCount, plural, one {V příchozí poště je {messagesCount} zpráva.} few {V příchozí poště jsou {messagesCount} zprávy. } other {V příchozí poště je {messagesCount} zpráv.}}",
"{messagesCount, plural, one {There's {messagesCount} message in your inbox.} other {There are {messagesCount} messages in your inbox.}}": "{messagesCount, plural, one {V příchozí poště je {messagesCount} zpráva.} few {V příchozí poště jsou {messagesCount} zprávy. } other {V příchozí poště je {messagesCount} zpráv.}}",
"Last login on {lastLogin,date}.": "Poslední přihlášení {lastLogin,date}",
}
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/react-native.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ We're going to translate the following app:
<Text>
{messagesCount === 1
? `There's {messagesCount} message in your inbox.`
: `There're ${messagesCount} messages in your inbox.`}
: `There are ${messagesCount} messages in your inbox.`}
</Text>
</View>
Expand Down
38 changes: 19 additions & 19 deletions docs/tutorials/react.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ We're going to translate the following app:
{
messagesCount === 1
? `There's ${messagesCount} message in your inbox.`
: `There're ${messagesCount} messages in your inbox.`
: `There are ${messagesCount} messages in your inbox.`
}
</p>
Expand Down Expand Up @@ -473,7 +473,7 @@ Let's move on and add i18n to another text in our component:
{
messagesCount === 1
? "There's {messagesCount} message in your inbox."
: "There're {messagesCount} messages in your inbox."
: "There are {messagesCount} messages in your inbox."
}
</p>
Expand Down Expand Up @@ -515,12 +515,12 @@ the right plural form:
<Plural
value={messagesCount}
one="There's # message in your inbox"
other="There're # messages in your inbox"
other="There are # messages in your inbox"
/>
</p>
This component will render ``There's 1 message in your inbox`` when
``messageCount = 1`` and ``There're # messages in your inbox`` for any other
``messageCount = 1`` and ``There are # messages in your inbox`` for any other
values of ``messageCount``. ``#`` is a placeholder, which is replaced with ``value``.

Cool! Curious how this component is transformed under the hood and how the
Expand All @@ -529,7 +529,7 @@ yourself::

{messagesCount, plural,
one {There's # message in your inbox}
other {There're # messages in your inbox}}
other {There are # messages in your inbox}}

In the catalog, you'll see the message in one line. Here we wrapped it to make it more readable.

Expand All @@ -550,12 +550,12 @@ You may wonder, why the following code doesn't work as expected:
<Plural
value={messagesCount}
zero="There're no messages"
zero="There are no messages"
one="There's # message in your inbox"
other="There're # messages in your inbox"
other="There are # messages in your inbox"
/>
This component will render ``There're 0 messages in your inbox`` for
This component will render ``There are 0 messages in your inbox`` for
``messagesCount = 0``. Why so? Because English doesn't have ``zero``
`plural form <http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#en>`_.

Expand All @@ -571,23 +571,23 @@ n other (anything else)

However, decimal numbers (even ``1.0``) use ``other`` form every time::

There're 0.0 messages in your inbox.
There are 0.0 messages in your inbox.

Aren't languages beautiful?

Exact forms
-----------

Alright, back to our example. What if we really want to render ``There're no messages``
Alright, back to our example. What if we really want to render ``There are no messages``
for ``messagesCount = 0``? Exact forms to the rescue!

.. code-block:: jsx
<Plural
value={messagesCount}
_0="There're no messages"
_0="There are no messages"
one="There's # message in your inbox"
other="There're # messages in your inbox"
other="There are # messages in your inbox"
/>
What's that ``_0``? MessageFormat allows exact forms, like ``=0``. However,
Expand All @@ -600,10 +600,10 @@ It works with any number, so we can go wild and customize it this way:
<Plural
value={messagesCount}
_0="There're no messages"
_0="There are no messages"
_1="There's one message in your inbox"
_2="There're two messages in your inbox, that's not much!"
other="There're # messages in your inbox"
_2="There are two messages in your inbox, that's not much!"
other="There are # messages in your inbox"
/>
… and so on. Exact matches always take precedence before plural forms.
Expand All @@ -619,7 +619,7 @@ Let's go back to our original pluralized message:
<Plural
value={messagesCount}
one="There's # message in your inbox"
other="There're # messages in your inbox"
other="There are # messages in your inbox"
/>
</p>
Expand All @@ -633,7 +633,7 @@ wrap messages in :jsxmacro:`Trans` macro or use template literals
<Plural
value={messagesCount}
one={`There's # message in your inbox, ${name}`}
other={<Trans>There're <strong>#</strong> messages in your inbox, {name}</Trans>}
other={<Trans>There are <strong>#</strong> messages in your inbox, {name}</Trans>}
/>
</p>
Expand All @@ -654,7 +654,7 @@ pass an ``id`` prop to :jsxmacro:`Plural` as we would to :jsxmacro:`Trans`:
id="Inbox.messagesCount"
value={messagesCount}
one="There's # message in your inbox"
other="There're # messages in your inbox"
other="There are # messages in your inbox"
/>
</p>

Expand Down Expand Up @@ -715,7 +715,7 @@ After all modifications, the final component with i18n looks like this:
<Plural
value={messagesCount}
one="There's # message in your inbox."
other="There're # messages in your inbox."
other="There are # messages in your inbox."
/>
</p>
Expand Down
4 changes: 2 additions & 2 deletions examples/create-react-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ function App() {
</div>
<Plural
value={count}
zero={"There're no books"}
zero={"There are no books"}
one={"There's one book"}
other={"There're # books"}
other={"There are # books"}
/>
<h3><Trans>Date formatter example:</Trans></h3>
<div>
Expand Down
2 changes: 1 addition & 1 deletion examples/create-react-app/src/locales/cs/messages.js

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

2 changes: 1 addition & 1 deletion examples/create-react-app/src/locales/cs/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@ msgid "Today is {0}"
msgstr "Dnes je {0}"

#: src/App.tsx:26
msgid "{count, plural, zero {There're no books} one {There's one book} other {There're # books}}"
msgid "{count, plural, zero {There are no books} one {There's one book} other {There are # books}}"
msgstr "{count, plural, zero {Nejsou žádné knihy} one {Je tu jedna kniha} other {Existuje # knih}}"
2 changes: 1 addition & 1 deletion examples/create-react-app/src/locales/en/messages.js

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

4 changes: 2 additions & 2 deletions examples/create-react-app/src/locales/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ msgid "Today is {0}"
msgstr "Today is {0}"

#: src/App.tsx:26
msgid "{count, plural, zero {There're no books} one {There's one book} other {There're # books}}"
msgstr "{count, plural, zero {There're no books} one {There's one book} other {There're # books}}"
msgid "{count, plural, zero {There are no books} one {There's one book} other {There are # books}}"
msgstr "{count, plural, zero {There are no books} one {There's one book} other {There are # books}}"
2 changes: 1 addition & 1 deletion examples/next-js/lingui-example/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ i18n.loadLocaleData("cs", { plurals: cs })

/**
* Load messages for requested locale and activate it.
* This function isn't part of the LinguiJS library because there're
* This function isn't part of the LinguiJS library because there are
* many ways how to load messages — from REST API, from file, from cache, etc.
*/
export async function activate(locale: string) {
Expand Down
2 changes: 1 addition & 1 deletion examples/next-js/locale/cs/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ msgstr "Vítá tě <0>LinguiJS!</0>"

#: pages/examples.tsx:15
#: pages/examples.tsx:19
msgid "{value, plural, one {There's one book} other {There're # books}}"
msgid "{value, plural, one {There's one book} other {There are # books}}"
msgstr "{value, plural, one {Je tam jedna kniha} few {Jsou tam # knihy} other {Je tam # knih}}"
4 changes: 2 additions & 2 deletions examples/next-js/locale/en/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ msgstr "Welcome to <0>LinguiJS!</0>"

#: pages/examples.tsx:15
#: pages/examples.tsx:19
msgid "{value, plural, one {There's one book} other {There're # books}}"
msgstr "{value, plural, one {There's one book} other {There're # books}}"
msgid "{value, plural, one {There's one book} other {There are # books}}"
msgstr "{value, plural, one {There's one book} other {There are # books}}"
4 changes: 2 additions & 2 deletions examples/next-js/pages/examples.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default function Home() {
<Plural
value={value}
one="There's one book"
other="There're # books"
other="There are # books"
/>
</p>
)}
Expand All @@ -31,7 +31,7 @@ export default function Home() {
<p>
{plural(value, {
one: "There's one book",
other: "There're # books",
other: "There are # books",
})}
</p>
)}
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/src/api/pseudoLocalize.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe("PseudoLocalization", () => {
it("with offset", () => {
expect(
pseudoLocalize(
"{count, plural, offset:1 zero {There're no messages} other {There're # messages in your inbox}}"
"{count, plural, offset:1 zero {There are no messages} other {There are # messages in your inbox}}"
)
).toEqual(
"{count, plural, offset:1 zero {Ţĥēŕē'ŕē ńō mēśśàĝēś} other {Ţĥēŕē'ŕē # mēśśàĝēś ĩń ŷōũŕ ĩńƀōx}}"
Expand All @@ -50,7 +50,7 @@ describe("PseudoLocalization", () => {
it("with HTML tags", () => {
expect(
pseudoLocalize(
"{count, plural, zero {There's # <span>message</span>} other {There're # messages}"
"{count, plural, zero {There's # <span>message</span>} other {There are # messages}"
)
).toEqual(
"{count, plural, zero {Ţĥēŕē'ś # <span>mēśśàĝē</span>} other {Ţĥēŕē'ŕē # mēśśàĝēś}"
Expand All @@ -60,7 +60,7 @@ describe("PseudoLocalization", () => {
it("with exact number", () => {
expect(
pseudoLocalize(
"{count, plural, =0 {There's # <span>message</span>} other {There're # messages}"
"{count, plural, =0 {There's # <span>message</span>} other {There are # messages}"
)
).toEqual(
"{count, plural, =0 {Ţĥēŕē'ś # <span>mēśśàĝē</span>} other {Ţĥēŕē'ŕē # mēśśàĝēś}"
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/lingui-compile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ if (require.main === module) {
)
console.log(` $ ${helpRun("compile")}`)
console.log("")
console.log(" # Compile translations but fail when there're missing")
console.log(" # Compile translations but fail when there are missing")
console.log(" # translations (don't replace missing translations with")
console.log(" # default messages or message IDs)")
console.log(` $ ${helpRun("compile --strict")}`)
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/format.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { formatElements } from "./format"
describe("formatElements", function () {
const html = (elements) => render(elements).container.innerHTML

it("should return string when there're no elements", function () {
it("should return string when there are no elements", function () {
expect(formatElements("")).toEqual("")
expect(formatElements("Text only")).toEqual("Text only")
})
Expand Down

1 comment on commit f73cb8c

@vercel
Copy link

@vercel vercel bot commented on f73cb8c Jan 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.