Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: nuxt-modules/i18n
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.4.0
Choose a base ref
...
head repository: nuxt-modules/i18n
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.4.1
Choose a head ref
  • 8 commits
  • 8 files changed
  • 3 contributors

Commits on Nov 27, 2019

  1. chore(test): Use Node 12.1.0 for testing instead of latest

    Fixes "Segmentation fault (core dumped)" error. Probably due to using
    node 13.
    rchl committed Nov 27, 2019
    Copy the full SHA
    87d332e View commit details
  2. Copy the full SHA
    f3207f7 View commit details
  3. chore(deps): lock file maintenance

    renovate-bot authored and rchl committed Nov 27, 2019
    Copy the full SHA
    cce8653 View commit details

Commits on Dec 2, 2019

  1. fix(routing): Restore handling of route argument in getRouteBaseName

    In 8a1c052 the functionality to pass
    route to `getRouteBaseName` was accidentally removed. Bring that back
    and update documentation to state what's the actual argument. It was
    incorrectly specifying `string | RawLocation` as argument while
    currently it has to be a `Route`.
    
    Resolves #539
    rchl committed Dec 2, 2019
    Copy the full SHA
    3685abb View commit details
  2. Bump js-cookie version to 2.2.1

    Alfiana Sibuea authored and rchl committed Dec 2, 2019
    Copy the full SHA
    c90aeb6 View commit details
  3. Copy the full SHA
    3d7a377 View commit details
  4. chore(deps): lock file maintenance

    renovate-bot authored and rchl committed Dec 2, 2019
    Copy the full SHA
    fd3e966 View commit details
  5. chore(release): 6.4.1

    rchl committed Dec 2, 2019
    Copy the full SHA
    fb6a6f9 View commit details
Showing with 789 additions and 789 deletions.
  1. +1 −1 .circleci/config.yml
  2. +7 −0 CHANGELOG.md
  3. +1 −1 docs/api/README.md
  4. +11 −11 package.json
  5. +2 −2 src/plugins/routing.js
  6. +8 −0 test/module.test.js
  7. +2 −2 types/vue.d.ts
  8. +757 −772 yarn.lock
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ executors:
type: boolean
default: false
docker:
- image: circleci/node:latest<<# parameters.browsers >>-browsers<</ parameters.browsers >>
- image: circleci/node:12<<# parameters.browsers >>-browsers<</ parameters.browsers >>
working_directory: ~/nuxt-i18n
environment:
NODE_ENV: test
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [6.4.1](https://github.com/nuxt-community/nuxt-i18n/compare/v6.4.0...v6.4.1) (2019-12-02)


### Bug Fixes

* **routing:** Restore handling of route argument in getRouteBaseName ([3685abb](https://github.com/nuxt-community/nuxt-i18n/commit/3685abba66edfb5e5b3720db8ba99d2af4127f13)), closes [#539](https://github.com/nuxt-community/nuxt-i18n/issues/539)

## [6.4.0](https://github.com/nuxt-community/nuxt-i18n/compare/v6.3.1...v6.4.0) (2019-11-18)


2 changes: 1 addition & 1 deletion docs/api/README.md
Original file line number Diff line number Diff line change
@@ -47,7 +47,7 @@ In `no_prefix` strategy, passing `locale` other than the current one is not supp
#### getRouteBaseName

- **Arguments**:
- route (type: `string` | [`Location`](https://github.com/vuejs/vue-router/blob/f40139c27a9736efcbda69ec136cb00d8e00fa97/types/router.d.ts#L125), default: current route)
- route (type: `Route`(https://github.com/vuejs/vue-router/blob/f40139c27a9736efcbda69ec136cb00d8e00fa97/types/router.d.ts#L135), default: current route)
- **Returns**: `string`

Returns base name of current (if argument not provided) or passed in `route`. Base name is name of the route without locale suffix and other metadata added by `nuxt-i18n`.
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuxt-i18n",
"version": "6.4.0",
"version": "6.4.1",
"description": "i18n for Nuxt",
"license": "MIT",
"contributors": [
@@ -64,27 +64,27 @@
"@kazupon/vue-i18n-loader": "^0.4.0",
"cookie": "^0.4.0",
"is-https": "^1.0.0",
"js-cookie": "^2.2.0",
"js-cookie": "^2.2.1",
"vue-i18n": "^8.12.0",
"vue-i18n-extensions": "^0.2.1"
},
"devDependencies": {
"@babel/core": "7.7.2",
"@babel/plugin-syntax-dynamic-import": "7.2.0",
"@babel/preset-env": "7.7.1",
"@babel/runtime": "7.7.2",
"@nuxt/types": "0.3.4",
"@babel/core": "7.7.4",
"@babel/plugin-syntax-dynamic-import": "7.7.4",
"@babel/preset-env": "7.7.4",
"@babel/runtime": "7.7.4",
"@nuxt/types": "0.5.3",
"@nuxtjs/module-test-utils": "1.5.0",
"@types/jest": "24.0.23",
"babel-core": "7.0.0-bridge.0",
"babel-eslint": "10.0.3",
"babel-plugin-dynamic-import-node": "2.3.0",
"chromedriver": "78.0.1",
"codecov": "3.6.1",
"eslint": "6.6.0",
"eslint": "6.7.2",
"eslint-config-standard": "14.1.0",
"eslint-plugin-import": "2.18.2",
"eslint-plugin-jest": "23.0.4",
"eslint-plugin-jest": "23.1.1",
"eslint-plugin-node": "10.0.0",
"eslint-plugin-promise": "4.2.1",
"eslint-plugin-standard": "4.0.1",
@@ -95,8 +95,8 @@
"nuxt": "2.10.2",
"puppeteer-core": "2.0.0",
"selenium-webdriver": "4.0.0-alpha.5",
"standard-version": "7.0.0",
"tib": "0.7.3",
"standard-version": "7.0.1",
"tib": "0.7.4",
"typescript": "3.7.2",
"vuepress": "1.2.0"
}
4 changes: 2 additions & 2 deletions src/plugins/routing.js
Original file line number Diff line number Diff line change
@@ -120,8 +120,8 @@ function switchLocalePath (locale) {
return path
}

function getRouteBaseName () {
const { route } = this
function getRouteBaseName (givenRoute) {
const route = givenRoute || this.route
if (!route.name) {
return null
}
8 changes: 8 additions & 0 deletions test/module.test.js
Original file line number Diff line number Diff line change
@@ -280,6 +280,14 @@ describe('basic', () => {
expect(window.$nuxt.getRouteBaseName()).toBe('index')
})

test('getRouteBaseName returns name of passed in route', async () => {
const window = await nuxt.renderAndGetWindow(url('/'))
const aboutRoute = window.$nuxt.$router.options.routes.find(route => route.path === '/about-us')
expect(aboutRoute).toBeDefined()
expect(aboutRoute.name).toBeDefined()
expect(window.$nuxt.getRouteBaseName(aboutRoute)).toBe('about')
})

test('localePath, switchLocalePath, getRouteBaseName works from a middleware', async () => {
const html = await get('/middleware')
const dom = getDom(html)
4 changes: 2 additions & 2 deletions types/vue.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Vue from 'vue'
import { RawLocation } from 'vue-router'
import { RawLocation, Route } from 'vue-router'
import VueI18n, { IVueI18n } from 'vue-i18n'
import { MetaInfo } from 'vue-meta'
import { NuxtI18nComponentOptions, NuxtVueI18n, NuxtI18nSeo } from './nuxt-i18n'
@@ -24,7 +24,7 @@ declare module 'vue/types/vue' {
interface Vue {
localePath(route: RawLocation, locale?: string): string
switchLocalePath(locale: string): string
getRouteBaseName(route?: RawLocation): string
getRouteBaseName(route?: Route): string
$nuxtI18nSeo(): NuxtI18nSeo
// PHPStorm without this indicates that "$i18n" was not found.
readonly $i18n: VueI18n & IVueI18n
1,529 changes: 757 additions & 772 deletions yarn.lock

Large diffs are not rendered by default.