Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nuxt-i18n

Package Overview
Dependencies
Maintainers
1
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nuxt-i18n - npm Package Compare versions

Comparing version 2.9.5 to 2.10.0

10

CHANGELOG.md

@@ -5,2 +5,12 @@ # Change Log

<a name="2.10.0"></a>
# [2.10.0](https://github.com/nuxt-community/nuxt-i18n/compare/v2.9.5...v2.10.0) (2018-04-30)
### Features
* **seo:** Add og:locale tags ([a688b6a](https://github.com/nuxt-community/nuxt-i18n/commit/a688b6a))
<a name="2.9.5"></a>

@@ -7,0 +17,0 @@ ## [2.9.5](https://github.com/nuxt-community/nuxt-i18n/compare/v2.9.4...v2.9.5) (2018-04-18)

50

lib/templates/i18n.seo.plugin.js

@@ -5,23 +5,35 @@ import Vue from 'vue'

head () {
if (this.$i18n && this.$i18n.ignorePaths.indexOf(this.$route.fullPath) === -1) {
// Prepare html lang attribute
const currentLocaleData = this.$i18n.locales.find(l => l.code === this.$i18n.locale)
const htmlAttrs = {}
if (currentLocaleData && currentLocaleData.iso) {
htmlAttrs.lang = currentLocaleData.iso
}
return {
htmlAttrs,
// Generate hreflang tags
link: this.$i18n.locales.map(locale => ({
hid: 'alternate-hreflang-' + locale.iso,
rel: 'alternate',
href: this.switchLocalePath(locale.code),
hreflang: locale.iso
}))
}
if (!this.$i18n || this.$i18n.ignorePaths.indexOf(this.$route.fullPath) !== -1) {
return {}
}
return {}
// Prepare html lang attribute
const currentLocaleData = this.$i18n.locales.find(l => l.code === this.$i18n.locale)
const htmlAttrs = {}
if (currentLocaleData && currentLocaleData.iso) {
htmlAttrs.lang = currentLocaleData.iso
}
return {
htmlAttrs,
// Generate hreflang tags
link: this.$i18n.locales.map(locale => ({
hid: 'alternate-hreflang-' + locale.iso,
rel: 'alternate',
href: this.switchLocalePath(locale.code),
hreflang: locale.iso
})),
meta: [
// Replace dash with underscore as defined in spec: language_TERRITORY
{ hid: 'og:locale', name: 'og:locale', property: 'og:locale', content: currentLocaleData.iso.replace(/-/g, '_') },
...this.$i18n.locales
.filter(l => l.iso !== currentLocaleData.iso)
.map(locale => ({
hid: 'og:locale:alternate-' + locale.iso,
name: 'og:locale:alternate',
property: 'og:locale:alternate',
content: locale.iso.replace(/-/g, '_')
}))
]
}
}
})
{
"name": "nuxt-i18n",
"version": "2.9.5",
"version": "2.10.0",
"description": "i18n for Nuxt",

@@ -5,0 +5,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc