Trait for multilingual resource file support

Last update: Oct 23, 2021

Usage

This library supports MultilingualResourceTrait which can be used in PluginBase.
Multilingual support of resource files is possible using this trait.
This library uses the language resource name pattern used by PMMP
Therefore, need to name the language resource file according to the established rules

Code of the language according to the ISO_639-3 standard

$resourcePath = "config/%s.yml";  
// Match to:  
// - resources/config/eng.yml  
// - resources/config/kor.yml  
// - resources/config/chz.yml  
// - resources/config/ind.yml  
// - resources/config/jpn.yml  

Example: Support multilingual in config.yml file

use kim\present\traits\multilingual\MultilingualResourceTrait;  

//Example source for saving the config.yml file  
class Main extends PluginBase{  
    use MultilingualResourceTrait;  

    public function saveDefaultConfig() : bool{  
        return $this->saveResourceByLanguage("config.yml", "config/%s.yml");  
    }  
}  

Use MultilingualConfigTrait

use kim\present\traits\multilingual\MultilingualConfigTrait;  

//Example source for saving the config.yml file  
class Main extends PluginBase{  
    use MultilingualConfigTrait;  
}  

API

public function saveResourceByLanguage(string $filename, string $resourcePath, bool $replace = false) : bool  
Param name Description
$filename File save path. It is saved in the plug-in data folder.
$resourcePath Resource file path. It is read from the plugin resource folder.
$replace Whether to overwrite the file

public function getResourceByLanguage(string $path) : ?resource  
Param name Description
$path Resource file path. It is read from the plugin resource folder.

GitHub

https://github.com/presentkim-pm/multilingual-resource-trait
You might also like...

Easy multilingual urls and redirection support for the Laravel framework

Linguist - Multilingual urls and redirects for Laravel This package provides an easy multilingual urls and redirection support for the Laravel framewo

Feb 13, 2022

A php trait to search laravel models

Searchable, a search trait for Laravel Searchable is a trait for Laravel 4.2+ and Laravel 5.0 that adds a simple search function to Eloquent Models. S

May 17, 2022

Generate and autoload custom Helpers, Builder Scope, Service class, Trait

laravel-make-extender Generate and autoload custom helpers, It can generate multilevel helpers in the context of the directory. Generate Service class

Apr 6, 2022

A simple mailable trait and interface to export mails to a storage disk once being sent.

Laravel Mail Export This package can export any mail sent with Laravel's Mailable class to any desired filesystem disk and path as a .eml file. This c

May 26, 2022

WP-CLI Trait Package Command

WP-CLI Trait Package Command Generate plugin or php model files e.g. post-type or taxonomy for WP-Trait Package in Develop WordPress Plugin. Installat

Dec 17, 2021

This package provides a trait that will generate a unique uuid when saving any Eloquent model.

Generate slugs when saving Eloquent models This package provides a trait that will generate a unique uuid when saving any Eloquent model. $model = new

Oct 14, 2021

A Single Table Inheritance Trait for Eloquent/Laravel

Single Table Inheritance Credit This code is a fork of Nanigans/single-table-inheritance. I've only updated it to work with Laravel 5 Single Table Inh

Feb 17, 2022

Trait for Laravel testing to count/assert about database queries

counts_database_queries Trait for Laravel testing to count/assert about database queries Installing composer require ohffs/counts-database-queries-tra

Feb 23, 2022

A Single Table Inheritance Trait for Eloquent/Laravel

Single Table Inheritance Single Table Inheritance is a trait for Laravel 5.8+ Eloquent models that allows multiple models to be stored in the same dat

May 2, 2022

This package provides a trait to run your tests against a MinIO S3 server.

Laravel MinIO Testing Tools This package provides a trait to run your tests against a MinIO S3 server. 📝 Blog post: https://protone.media/en/blog/how

May 20, 2022

File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery

File Upload widget with multiple file selection, drag&drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.

May 28, 2022

TinyFileManager is web based file manager and it is a simple, fast and small file manager with a single file, multi-language ready web application

TinyFileManager is web based file manager and it is a simple, fast and small file manager with a single file, multi-language ready web application

TinyFileManager is web based file manager and it is a simple, fast and small file manager with a single file, multi-language ready web application for storing, uploading, editing and managing files and folders online via web browser. The Application runs on PHP 5.5+, It allows the creation of multiple users and each user can have its own directory and a build-in support for managing text files with cloud9 IDE and it supports syntax highlighting for over 150+ languages and over 35+ themes.

May 22, 2022

Feel free to create new file, don't hesitate to pull your code, the most important thing is that the file name here must match your nickname so that file does not conflict with other people.

PHP-Projects hacktoberfest Contributing Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to cha

Jan 28, 2022

Adds CORS (Cross-Origin Resource Sharing) headers support in your Laravel application

CORS Middleware for Laravel Implements https://github.com/asm89/stack-cors for Laravel About The laravel-cors package allows you to send Cross-Origin

May 23, 2022

CORS (Cross-Origin Resource Sharing) support for Laravel and Lumen

Description This package adds Cross-Origin Resource Sharing (CORS) support to your Laravel application. The package is based on Framework agnostic (PS

Feb 1, 2020

Translate laravel resource, vendor, folder or file from google translation without requiring any api information

Translate laravel resource, vendor, folder or file from google translation without requiring any api information

⚡ ⚡ ⚡ Laravel Go Translate Translate laravel resource, vendor, folder or file from google translation without requiring any api information. Table of

May 19, 2022

[Deprecated] A Laravel package for multilingual models

[Deprecated] A Laravel package for multilingual models

This package has been deprecated. But worry not. You can use Astrotomic/laravel-translatable. Laravel-Translatable If you want to store translations o

Apr 20, 2022

Multilingual PHP CMS built with Laravel and bootstrap

Multilingual PHP CMS built with Laravel  and bootstrap

Lavalite This is an open source of Content Management System developed with Laravel framework. Documentation Visit Documentation section in the websit

May 28, 2022

Multilingual CMS built with Laravel.

Multilingual CMS built with Laravel.

TypiCMS TypiCMS is a modular multilingual content management system built with Laravel. Out of the box you can manage pages, events, news, places, men

May 18, 2022
[Deprecated] A Laravel package for multilingual models
[Deprecated] A Laravel package for multilingual models

This package has been deprecated. But worry not. You can use Astrotomic/laravel-translatable. Laravel-Translatable If you want to store translations o

Apr 20, 2022
A convenience package for php multilingual web applications
A convenience package for php multilingual web applications

PHP Translation Install Lifecycle Configuration Content of PHP File Content of Json File Content Of Database Table Use Of Array Or Json Database PHP T

Sep 27, 2021
Support multiple language resources for Laravel

Laratrans Support multiple language resources for Laravel. Docs Installation composer require lechihuy/laratrans After you install the package success

Dec 21, 2021
Provides support for message translation and localization for dates and numbers.

The I18n library provides a I18n service locator that can be used for setting the current locale, building translation bundles and translating messages. Additionally, it provides the Time and Number classes which can be used to output dates, currencies and any numbers in the right format for the specified locale.

Mar 3, 2022
75 languages support for Laravel 5 application based on Laravel-Lang/lang.

Laravel-lang 75 languages support for Laravel 5 application based on Laravel-Lang/lang. Features Laravel 5+ && Lumen support. Translations Publisher.

May 19, 2022
Generates a vue-i18n compatible include file from your Laravel translations

This is fork of martinlindhe/laravel-vue-i18n-generator to give Laravel 8+ support for this excellent package.

Nov 11, 2021
Trait for multilingual resource file support

⚡ Usage This library supports MultilingualResourceTrait which can be used in PluginBase. Multilingual support of resource files is possible using this

Oct 23, 2021
Pico disk, Not need any database, support html5, support mp3, mp4, support streaming media, support AriaNg
Pico disk, Not need any database, support html5, support mp3, mp4, support streaming media, support AriaNg

Nano netdisk, Now changed to pico disk. Pico disk,does not need any database, support html5, support mp3, mp4, support streaming media, support AriaNg.

May 10, 2022
Tag support for Laravel Eloquent models - Taggable Trait

Laravel Taggable Trait This package is not meant to handle javascript or html in any way. This package handles database storage and read/writes only.

May 12, 2022