👻
VILT Stack Generator
  • Get Started
    • 👻Overview
    • 💻Environment Setup
    • 🚀Install
  • Generate
    • 🧠Resource
    • 🔥Action
    • 🧩Modal
    • 📈Widget
    • 📏Route
    • 🖥️Views
    • 🔒Roles
  • Resource
    • 🔦Using
    • 🪝Hooks
    • 📤Import & Export
  • Builders
    • 🔡Form
    • 📺Table
    • 📄Page
  • Components
    • 💫Using
    • 🆎Text
    • 🔤Textarea
    • 🔠Rich
    • 🔢Number
    • 📞Tel
    • ✉️Email
    • 🔄Toggle
    • 🖌️Color
    • 📅Date
    • ⌛Time
    • ⏲️DateTime
    • ⚡Select
    • 🔁Repeater
    • 📑Schema
    • ✨Section
    • 🖼️Media
    • 💟HasOne
    • 🎁Relation
  • Managers
    • 🔤Translation
    • 📖Menu
    • ♠️Share
  • Helpers
    • ⚠️Alert
    • 💻Render
    • 🌠Actions
    • 🌟Modal
  • Plugins
    • 🔤Translations
    • 📀Settings
    • 📖Menus
    • 🔔Notifications
    • 💳Payment
    • 🏗️Build Plugins
  • Learning
    • 🙏Task To Get Start
    • 🚨CI/CD
    • 🦄Awesome TailwindCSS
Powered by GitBook
On this page
  • Use in Resource
  • Use in Provider
  1. Managers

Translation

you can add more translations to your app by using langs(){} method on the Resource class

Use in Resource

inside your ResourceFolder/Traits you will get a trait for transitions Transaltion.php you can add more translation to it

public function loadTranslations(): array
{
    return [
        "index" => __("{{ headerTranslationName }}"),
        "create" => __('Create ' . "{{ fieldsTranslationName }}"),
        "bulk" => __('Delete Selected ' . "{{ fieldsTranslationName }}"),
        "edit_title" => __('Edit ' . "{{ fieldsTranslationName }}"),
        "create_title" => __('Create New ' . "{{ fieldsTranslationName }}"),
        "view_title" => __('View ' . "{{ fieldsTranslationName }}"),
        "delete_title" => __('Delete ' . "{{ fieldsTranslationName }}"),
        "bulk_title" => __('Run Bulk Action To ' . "{{ fieldsTranslationName }}"),
    ];
}

Use in Provider

you can use the Lang::class direct on the provider by using VILT::class like

VILT::registerTranslation(Lang::make('users.sidebar')->label(__('User')));

it will pass the users.sidebar to the vuejs inside this.$attrs.data.trans array

PreviousRelationNextMenu

Last updated 2 years ago

🔤