Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hydrogen i18n example #1279

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions examples/.gitignore
@@ -0,0 +1 @@
.shopify
5 changes: 5 additions & 0 deletions examples/i18n/.eslintignore
@@ -0,0 +1,5 @@
build
node_modules
bin
*.d.ts
dist
18 changes: 18 additions & 0 deletions examples/i18n/.example.eslintrc.js
@@ -0,0 +1,18 @@
/**
* @type {import("@types/eslint").Linter.BaseConfig}
*/
module.exports = {
extends: [
'@remix-run/eslint-config',
'plugin:hydrogen/recommended',
'plugin:hydrogen/typescript',
],
rules: {
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/naming-convention': 'off',
'hydrogen/prefer-image-component': 'off',
'no-useless-escape': 'off',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
'no-case-declarations': 'off',
},
};
8 changes: 8 additions & 0 deletions examples/i18n/.gitignore
@@ -0,0 +1,8 @@
node_modules
/.cache
/build
/dist
/public/build
/.mf
.env
.shopify
1 change: 1 addition & 0 deletions examples/i18n/.graphqlrc.yml
@@ -0,0 +1 @@
schema: node_modules/@shopify/hydrogen-react/storefront.schema.json
48 changes: 48 additions & 0 deletions examples/i18n/README.md
@@ -0,0 +1,48 @@
# Hydrogen i18n Example

Hydrogen is Shopify’s stack for headless commerce. Hydrogen is designed to dovetail with [Remix](https://remix.run/), Shopify’s full stack web framework. This template contains a **minimal setup** of components, queries and tooling to get started with Hydrogen.

This example demonstrates how to implement a performant i18n strategy including static language
translations for a subfolder e.g example.com/fr-CA localization strategy.

[Check out Hydrogen docs](https://shopify.dev/custom-storefronts/hydrogen)
[Get familiar with Remix](https://remix.run/docs/en/v1)

## Hydrogen i18n draft RFC

For detailed instructions of the proposed utilities and how to implement them in your project
please read the `RFC.md` in this project.

## What's included

- Remix
- Hydrogen
- Oxygen
- Shopify CLI
- ESLint
- Prettier
- GraphQL generator
- TypeScript and JavaScript flavors
- Minimal setup of components and routes

## Getting started

**Requirements:**

- Node.js version 16.14.0 or higher

```bash
npm create @shopify/hydrogen@latest
```

## Building for production

```bash
npm run build
```

## Local development

```bash
npm run dev
```