evo-mark/inertia-i18n 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

evo-mark/inertia-i18n

最新稳定版本:v3.1.1

Composer 安装命令:

composer require evo-mark/inertia-i18n

包简介

Internationalisation support for Inertia projects

README 文档

README

evoMark company logo

Build status Total Downloads License

Inertia I18n

Upgrading from V2

Please see the CHANGELOG.md file for upgrade instructions

Installation

composer require evo-mark/inertia-i18n
npm install ./vendor/evo-mark/inertia-i18n

pnpm add file:vendor/evo-mark/inertia-i18n
import InertiaI18n from "inertia-i18n/vite";

export default {
	plugins: [
		InertiaI18n({
			// langDirectory: resolve(process.cwd() + "/lang"),
			// outputDirectory: resolve(process.cwd() + "/lang/json"),
		}),
	],
};
import { inertiaI18nVue } from "inertia-i18n/vue";

createInertiaApp({
	withApp(app) {
		app.use(inertiaI18nVue);
	},
});

Config

You can publish the config, if necessary, with Artisan:

php artisan v:p --tag=inertia-i18n

Your path should match the outputDirectory in your Vite plugin config (default /lang)

Usage

After installation, you can use your frontend localisation package as usual:

<template>
	<div>{{ $t('messages.hello_world') }}</div>
</template>

OR

<script setup>
import { useI18n } from 'vue-i18n';

const { t } = useI18n();
const translated = computed(() => t('message.hello_world));
</script>

See the documentation for the respective frontend packages for more information:

Vue: vue-i18n

统计信息

  • 总下载量: 1.47k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 3
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 3
  • Forks: 0
  • 开发语言: JavaScript

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固