承接 seiger/slang 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

seiger/slang

Composer 安装命令:

composer require seiger/slang

包简介

Evocms package for work with Multi lang management for Resource and modules in Evolution CMS. Seiger Lang multi language Management Module for Evolution CMS admin panel. The work of the module is based on the use of the standard Laravel functionality for multilingualism.

README 文档

README

sLang Latest Stable Version CMS Evolution PHP version License Issues Stars Total Downloads

sLang is a robust multilingual Management Module meticulously crafted for the Evolution CMS admin panel. This dynamic package empowers users to seamlessly implement and manage multilingual tools within the Evolution CMS environment. By utilizing Evolution CMS as its platform, sLang offers a streamlined solution for users seeking efficient and intuitive ways to handle diverse language content, making it an indispensable asset for administrators and developers navigating the intricacies of multilingual website management.

The work of the module is based on the use of the standard Laravel functionality for multilingualism. This foundation ensures a reliable and well-established framework for managing multilingual aspects, enhancing the module's performance and aligning it with industry best practices. With its focus on simplicity and integration, sLang emerges as an essential companion for those aiming to enhance the linguistic versatility of their Evolution CMS-powered websites.

Features

  • Automatic Phrase Translation through Google or Custom.
  • Automatic search for translations in templates.
  • Multilingual tabs in resource.
  • Unlimited Translation Language Support.
  • Multilingual SEO Support.

Multilingual tabs

Requirements

  • Evolution CMS 3.3+
  • PHP 8.3+
  • Composer 2.2+
  • One of: MySQL 8.0+ / MariaDB 10.5+ / PostgreSQL 10+ / SQLite 3.25+

Install by artisan package installer

Go to You /core/ folder:

cd core

Run php artisan command

php artisan package:installrequire seiger/slang "*"
php artisan vendor:publish --provider="Seiger\sLang\sLangServiceProvider"

Run make DB structure with command:

php artisan migrate

Local shared demo workflow

This repo is developed inside the shared Extras demo:

cd /Users/dmi3yy/PhpstormProjects/Extras/sArticles/demo/core
composer update seiger/slang --with-all-dependencies
php artisan package:discover
php artisan migrate --force

The shared demo also loads sArticles, dmi3yy/dissues, sSeo, evo-ui, dTui-editor, and eTinyMCE. Before writing to dIssues task data, create a DB backup:

php /Users/dmi3yy/PhpstormProjects/MiddleDuck/skills/dissues-demo-ops/scripts/dissues-demo.php backup

Run the sLang smoke check from this repo:

php tests/demo-smoke.php --url=http://127.0.0.1:8791

Run the targeted regression test for Dictionary CRUD and Settings state:

php tests/regression/slang-demo-regression.php

The manager module shell now uses evo-ui for Dictionary and Settings. Resource edit multilingual tabs remain legacy-compatible and keep the existing Evolution mutate form contract.

Usage in blade

Current language:

{{evo()->getConfig('lang')}}
or
{{evo()->getLocale()}}

Default language:

{{evo()->getConfig('s_lang_default')}}

List of frontend languages by comma:

{{evo()->getConfig('s_lang_front')}}

Translation of phrases:

@lang('phrase')

Localized versions of your page for Google hreflang

{!!sLang::hreflang()!!}

Content management

Show current language anywhere with name or shortname

{{Str::upper(sLang::langSwitcher()[evo()->getConfig('lang')]['short'])}}

Implementing a Language Switcher

@foreach(sLang::langSwitcher() as $lang)
    <a href="{{$lang['link']}}">{{Str::upper($lang['ISO 639-1'])}}</a>
@endforeach

Working with localized content (Eloquent)

The Seiger\sLang\Models\sLangContent model now applies the current locale automatically.

  • Fetch translated rows for the active locale:
    use Seiger\sLang\Models\sLangContent;
    
    $items = sLangContent::active()->get(); // locale resolved via evo()->getLocale()
  • Select a specific locale explicitly:
    $items = sLangContent::lang('en')->get();
  • Include template variables while keeping the locale filtering:
    $items = sLangContent::withTVs(['color', 'price'])->get();
  • Combine multiple helpers:
    $items = sLangContent::lang('uk')
        ->withTVs(['color', 'price'])
        ->whereParent($parentId)
        ->active()
        ->get();
  • Legacy helper is preserved for backward compatibility:
    $items = sLangContent::langAndTvs('en', ['color', 'price'])->get();

    Deprecated: langAndTvs() is deprecated since 1.0.8 and is scheduled for removal in v1.2. Use lang()->withTVs() instead.

Documentation

seiger/slang 适用场景与选型建议

seiger/slang 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 342 次下载、GitHub Stars 达 8, 最近一次更新时间为 2022 年 10 月 15 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「language」 「lang」 「evocms」 「evolution-cms」 「translation-management」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 seiger/slang 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 seiger/slang 我们能提供哪些服务?
定制开发 / 二次开发

基于 seiger/slang 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 342
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 26
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 8
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2022-10-15