承接 rocketage/sculpin-multilingual-bundle 相关项目开发

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

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

rocketage/sculpin-multilingual-bundle

Composer 安装命令:

composer require rocketage/sculpin-multilingual-bundle

包简介

Sculpin Multilingual Bundle

README 文档

README

Description

This extension was created to handle a Sculpin multi-lingual site where each language occupies a separate subdomain.

Out of the box Sculpin can already provide this with a directory within the source directory for each language subdomain.

For example a spanish/english site running on es.example.com and en.example.com could use:

> tree source
source
├── en
│   ├── about.html
│   └── contact.html
└── es
    ├── contacto.html
    └── sobre.html 
    
> sculpin generate
    
> tree output_dev
    
output_dev
├── en
│   ├── about.html
│   └── contact.html
└── es
    ├── contacto.html
    └── sobre.html    

This is fine to render the files for each language from a unique source for each subdomain, but if any files need to be shared across all subdomains (css/js/images) then either copy/paste or symlinks are required which can get messy across many subdomains.

This extension allows you to define a shared directory in the Sculpin source directory for shared assets and define which target directories the shared resource should populate.

The example again using the extension setup to share images, js and css:

> tree source
source
├── en
│   ├── about.html
│   └── contact.html
├── es
│   ├── contacto.html
│   └── sobre.html
└── shared
    ├── css
    │   └── site.css
    ├── img
    │   └── image.jpg
    └── js
        └── site.js
 
> sculpin generate        
        
> tree output_dev
output_dev
├── en
│   ├── about.html
│   ├── contact.html
│   ├── css
│   │   └── site.css
│   ├── img
│   │   └── image.jpg
│   └── js
│       └── site.js
└── es
    ├── contacto.html
    ├── css
    │   └── site.css
    ├── img
    │   └── image.jpg
    ├── js
    │   └── site.js
    └── sobre.html        

Installation

Edit your sculpin.json file:

{
    // ...
    "require": {
        // ...
        "rocketage/sculpin-multilingual-bundle": "@dev"
    }
}

and install by running sculpin update.

Now register the bundle in app/SculpinKernel.php:

class SculpinKernel extends \Sculpin\Bundle\SculpinBundle\HttpKernel\AbstractKernel
{
    protected function getAdditionalSculpinBundles()
    {
        return array(
            'Rocketage\Sculpin\Bundle\MultilingualBundle\SculpinMultilingualBundle'
        );
    }
}

Configuration

Define the shared directory name and the target direcotries in the Sculpin app config app/config/sculpin_kernel.yml:

sculpin_multilingual:
  shared_directory: 'shared'
  target_directories:
    - en
    - es

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-06-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固