• J
    Add initial changes for i18n support (#17370) · b2d1d87e
    JJ Kasper 提交于
    This adds the initial changes outlined in the [i18n routing RFC](https://github.com/vercel/next.js/discussions/17078). This currently treats the locale prefix on routes similar to how the basePath is treated in that the config doesn't require any changes to your pages directory and is automatically stripped/added based on the detected locale that should be used. 
    
    Currently redirecting occurs on the `/` route if a locale is detected regardless of if an optional catch-all route would match the `/` route or not we may want to investigate whether we want to disable this redirection automatically if an `/index.js` file isn't present at root of the pages directory. 
    
    TODO: 
    
    - [x] ensure locale detection/populating works in serverless mode correctly
    - [x] add tests for locale handling in different modes, fallback/getStaticProps/getServerSideProps
    
    To be continued in fall-up PRs
    
    - [ ] add tests for revalidate, auto-export, basePath + i18n
    - [ ] add mapping of domains with locales
    - [ ] investigate detecting locale against non-index routes and populating the locale in a cookie
    
    x-ref: https://github.com/vercel/next.js/issues/17110
    b2d1d87e
next.config.js 192 字节