Download the PHP package atico/spreadsheet-translator-symfony-bundle without Composer
On this page you can find all versions of the php package atico/spreadsheet-translator-symfony-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download atico/spreadsheet-translator-symfony-bundle
More information about atico/spreadsheet-translator-symfony-bundle
Files in atico/spreadsheet-translator-symfony-bundle
Package spreadsheet-translator-symfony-bundle
Short Description Spreadsheet Translator Bundle - Translate your web site from excel files (local, google drive with or without auth, onedrive with or without auth)
License MIT
Informations about the package spreadsheet-translator-symfony-bundle
Spreadsheet Translator Symfony Bundle
The Spreadsheet Translator Symfony Bundle allows creating translation files for your web projects from spreadsheet files (local or remote excel files).
There are some demos at the end of the documentation that aims to help you as much as possible.
This bundle is able to manage Spreadsheet files (xls/xlsx) from a local drive or cloud services such as: Google Drive and Microsoft One Drive, both of them with or without authentication.
The main advantages for managing web translations from spreadsheet files are:
- Avoid programming a backend.
- Avoid implementing/setting up a security system for users with the role translator.
- For cloud documents, the translation file can be editable by several users at the same time.
- Avoid installing aditional desktop software for managing not really human readable translation file formats (xliff, yml, php).
- Several translation files can be easily automated and distributed to several servers/environments.
- Using third party SpreadSheet apps, such as Google Drive, allow watching several translations in several languages at a glance, because of the column view.
- Most of these third party apps bring great tools out-of-the-box such as: search, copy, paste, replace text. (Microsoft Excel, Free Office, Google Drive, One Drive).
- Almost everyone is familiar with existing spreadsheets apps, most of the times more productive than onward/backward web based backend systems.
- Avoid innecessary database queries for each translation entry or complex cache infrastructure.
Example of Spreadsheet File with a single tab
Adapters
The bundle is constructed having in mind separation of concerns, so functionallities are splitted in 3 types of adapters.
-
Providers: Allow to grasp the Spreadsheet information from 5 different sources:
- Local file (Default)
- Google Drive shared view document
- Google Drive with authentication
- Microsft One Drive shared view document
- Microsft One Drive with authentication
-
Readers: Allow to read the Spreadsheet file in different manners to expose the data to an exporter.
- Matrix (Default)
- Xlsx
- Exporters: Allow to export the provided Spreadsheet file into 3 types of translation file formats:
- Xliff (Default)
- Yaml
- Php
Installation
Add the atico/spreadsheet-translator-symfony-bundle package to your require section in the composer.json file (*)
Add the Spreadsheet Translator Symfony Bundle to your application's kernel:
You need to separately install 3 adapters: a provider, a reader and an exporter.
(*) For the default configuration to work, three additional packages are required:
Configuration
Add to config.yml the following entry:
Adapters as independent Packages
-
Providers:
-
Readers:
- Exporters:
Links to the libraries:
Structure of Spreadsheet File with a single tab
tab name: common
Section and subsection will be joined with a dot, you can specify another character by setting a custom shared->name_separator value. In this case there will be 2 different translation keys: homepage.title and homepage.subtitle.
The package automatically detects locales by their format, in this example these are the titled columns: es_ES, en_GB and fr_FR.
The package will translate the tab with the name specified in the configuration exporter->domain value. It's planned to extend this behaviour to several tabs or all the tabs.
The configuration allows a lazy mode parameter (shared => lazy_mode). This will allow inheriting which helps writing faster, having a more clear view of the translation keys and avoiding copy and paste mistakes.
Structure of Spreadsheet File with a single tab in lazy mode
There will be 3 files created at app/Resources/translations: demo_common.es_ES.xliff, demo_common.en_GB.xliff and demo_common.frFR.xliff. Please notice the prefix demo, this is the value set at the configuration var exporter->prefix.
The contents for the exporter->format to xliff, the resulting file contents for es_ES (demo_common.es_ES.xliff) are:
There are two additional exporter formats adapters, you must include them in your composer json before using them.
Setting exporter->format to php would result for en_GB (demo_common.en_GB.php) the following translation file:
And finally, setting the exporter->format to yml would result for fr_FR (demo_common.fr_FR.yml) the following translation file:
Lightweight Symfony Demos
- Local file as a spreadsheet source file and php format for translated file.
- Google Spreadsheet with read permisions as source (without Auth) and yml format for translated file.
- Google Spreadsheet with Authentication required as source and php format for translated file.
Requirements
- PHP >=5.5.9
- Symfony ~2.3|~3.0
Contributing
We welcome contributions to this project, including pull requests and issues (and discussions on existing issues).
If you'd like to contribute code but aren't sure what, the issues list is a good place to start. If you're a first-time code contributor, you may find Github's guide to forking projects helpful.
All contributors (whether contributing code, involved in issue discussions, or involved in any other way) must abide by our code of conduct.
License
Spreadsheet Translator Symfony Bundle is licensed under the MIT License. See the LICENSE file for full details.
All versions of spreadsheet-translator-symfony-bundle with dependencies
php Version >=8.0
symfony/config Version ^6.0
symfony/dependency-injection Version ^6.0
symfony/yaml Version ^6.0
symfony/http-kernel Version ^6.0