Skip to content

Commit

Permalink
Russian translation: (vercel#172)
Browse files Browse the repository at this point in the history
* Russian transaltion:
- Added russian localization
- Added translation for Features from index page (components/features.js) with fallback to English
- Small typo fixes found during translation

* Added SVGs translation option (#2)

- Contributers now can easily translate SVGs by just passing path string
- Moved all hard-coded SVGs from pages to components/diagrams/
- If no 'translation' is provided it fallbacks to default locale (en-US)
  • Loading branch information
valentinpolitov authored Oct 29, 2021
1 parent 4ce21ed commit b81461a
Show file tree
Hide file tree
Showing 53 changed files with 2,852 additions and 350 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ And visit `localhost:3000` to preview your changes.

- https://github.com/vercel/swr-site/graphs/contributors
- Simplified Chinese translation done by Fang Lu ([@huzhengen](https://github.com/huzhengen))
- Spanish translation done by Markoz Peña ([@markozxuu](https://twitter.com/markozxuu))
- Spanish translation done by Markoz Peña ([@markozxuu](https://twitter.com/markozxuu))
- Japanese translation done by uttk ([@uttk](https://github.com/uttk)), Tomohiro SHIOYA ([@shioyang](https://github.com/shioyang))
- Korean translation done by SeulGi Choi ([@cs09g](https://github.com/cs09g))
- Russian translation done by Valentin Politov ([@valentinpolitov](https://github.com/valentinpolitov))
58 changes: 38 additions & 20 deletions components/diagrams/cache.js

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions components/diagrams/drawer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { useRouter } from "next/router";

export const draw = (paths = {}, name = "") => {
const { locale, defaultLocale } = useRouter();

if (!paths.hasOwnProperty(defaultLocale)) {
throw new Error(
`Please provide '${defaultLocale}' locale inside '${paths}'.`
);
}

if (
typeof paths[locale] === "string" &&
typeof paths[defaultLocale] === "string"
) {
return paths[locale] || paths[defaultLocale];
}

return paths[locale]?.[name] || paths[defaultLocale][name];
};
38 changes: 38 additions & 0 deletions components/diagrams/infinite.js

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

Loading

0 comments on commit b81461a

Please sign in to comment.