dereuromark / cakephp-translate Goto Github PK
View Code? Open in Web Editor NEWA CakePHP plugin to manage translations of your static content the easy way via web backend.
License: MIT License
A CakePHP plugin to manage translations of your static content the easy way via web backend.
License: MIT License
Readme says cakephp 4+ but v0.1.3 uses cakephp 3.8
composer require dereuromark/cakephp-translate
Is there currently not composer version for cakephp4?
composer require dereuromark/cakephp-translate
Using version ^0.1.3 for dereuromark/cakephp-translate
./composer.json has been updated
Running composer update dereuromark/cakephp-translate
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires dereuromark/cakephp-translate ^0.1.3 -> satisfiable by dereuromark/cakephp-translate[0.1.3].
- dereuromark/cakephp-translate 0.1.3 requires cakephp/cakephp ^3.8.0 -> found cakephp/cakephp[3.8.0, ..., 3.9.6] but it conflicts with your root composer.json require (~4.2.0).
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
Migrate https://github.com/dereuromark/cakephp-setup/blob/cake2/Console/Command/TranslationsShell.php
Validating PO files.
//EDIT Could also be moved to https://github.com/dereuromark/cakephp-translate
Basically the same solution as gourmet/whoops#13
Also useful:
Allow replacing all code __(...) with a different string from the backend with a single click.
Check all referenced files and preg_replace() it, switching it out in the POT files and in Translate backend at the same time.
Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'default, status, created, modified) VALUES ('my-app', 0, 1, 1, '2017-05-19 ' at line 1
INSERT INTO translate_projects (name, type, default, status, created, modified) VALUES (:c0, :c1, :c2, :c3, :c4, :c5)
Ways to reproduce:
As subject
When I navigate to the project index, I do not see any record action buttons:
HTML:
<td class="actions">
<a href="/my_app/admin/translate/translate-projects/view/1"><i class="icon icon-view fa fa-eye" title="" data-placement="bottom" data-toggle="tooltip" data-original-title="View"></i></a>
<a href="/my_app/admin/translate/translate-projects/edit/1"><i class="icon icon-edit fa fa-pencil" title="" data-placement="bottom" data-toggle="tooltip" data-original-title="Edit"></i></a>
<form name="post_591ee7a78d00d381740057" style="display:none;" method="post" action="/my_app/admin/translate/translate-projects/delete/1"><input name="_method" value="POST" type="hidden"></form>
<a href="#" onclick="if (confirm("Are you sure you want to delete # 1?")) { document.post_591ee7a78d00d381740057.submit(); } event.returnValue = false; return false;"><i class="icon icon-delete fa fa-trash" title="" data-placement="bottom" data-toggle="tooltip" data-original-title="Delete"></i></a>
</td>
Probably related to #6
Following installation by letter.
At the "Project Index" (/admin/translate/translate-projects)
I get only the
Element file "Tools.Element\pagination.ctp" is missing.
I'm not sure about which additional information would be useful.
PHP : 5.6.25
Cakephp: 3.4.8
When I navigate to /admin/translate/translate-strings/dump, I can press the submit button even though I have no locale file under src\Locale/ + {locale}
yet.
This leads to an MySQL error:
Error: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'translate_project_id' cannot be null
If you are using SQL keywords as table column names, you can enable identifier quoting for your database connection in config/app.php.
SQL Query:
INSERT INTO translate_domains (name, translate_project_id, created, modified) VALUES (:c0, :c1, :c2, :c3)
Fresh cake4 (v4.2.3) installation. Happens when I open http://localhost:8765/admin/translate/
My steps:
composer require dereuromark/cakephp-translate:dev-master
bin/cake plugin load Translate
bin/cake migrations migrate -p Translate
When I navigate to /admin/translate/translate-strings/extract, select both available POT files (cake, default) and rpess submit, it shows me a MySQL error:
Error: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'translate_project_id' cannot be null
SQL Query:
INSERT INTO translate_domains (name, translate_project_id, created, modified) VALUES (:c0, :c1, :c2, :c3)
I had no way of choosing a project, though I have added one in the DB beforehand.
When I run
myapp>bin\cake.bat translate
It shows:
Usage:
cake translate.translate [subcommand] [-h] [-q] [-v]
Subcommands:
help Display some help.
To see help on a subcommand use `cake translate.translate [subcommand] --help`
Options:
--help, -h Display this help.
--quiet, -q Enable quiet output.
--verbose, -v Enable verbose output.
What sub commands can I use?
Hello,
Kindly help, I can't get to translate via CLI and web browser.
Please helpout.
Thanks.
for translating
useful for placeholders and most importantly HTML content.
(Theoretically) it is possible to have more than one locale per language.
For example one could have three locales for the German language (de):
de_DE
for German from Germanyde_CH
for German from Switzerlandde_DE
for German from AustriaThe current implementation uses the ISO2 language code to process, extract and dump data.
Also, if one uses the full locale string as locale folder (de_CH) name instead of just the language ISO2 (de), he will end up with two locale folders.
When I navigate to the overview page, it shows me the following "process":
Please create a project first: Project Index
How to Translate
1. Select domain you want to translate
2. Select language you want to translate into (or from)
3. Translate and submit the form
After working around #5 by manually inserting the project record into the DB , I had a translation project.
If I follow this process order, I should now select a (translation) domain, but I have none yet.
I guess these steps lack at least one step in between.
I tested this plugin with a project of ours that is currently under development.
Since it is a public facing application we have a totally custom template and do not include the CakePHP CSS files.
When I navigate to /admin/translate/ it looks like this:
It seems the plugin does not provide its own default template nor other styling, thus the whole view is rendered in the front facing template which is not optimized for the plugin.
Depending on the custom styling of the application it could look worse.
Wouldn't it make sense to either include a default template with custom styling or provide instructions on what needs to be styled to make the life of an integrator easier?
https://github.com/dereuromark/cakephp-transifex
etc
Or other services like this.
Maybe export/import from them into the plugin.
Also add JSON export/import between local, staging and live server
Hello Dereuromark,
I need to report a issue regarding mysql error which occurs due to usage of mysql reserved words as a column name. Simply, I'm not able to create a project, my query fails:
INSERT INTO translate_projects (
name, type, default, status, created,
modified
)
VALUES
(
'test', 0, 0, 2, '2017-08-16 12:15:30',
'2017-08-16 12:15:30'
)
because usage of words "type", "default", "status" as column name is not allowed and recommended by mysql. Please find list of all reserved words on mysql webpage: https://dev.mysql.com/doc/refman/5.5/en/keywords.html and https://stackoverflow.com/questions/23446377/syntax-error-due-to-using-a-reserved-word-as-a-table-or-column-name-in-mysql
UPDATE: mysql version:
mysql> SHOW VARIABLES LIKE "%version%";
+-------------------------+-------------------------+
| Variable_name | Value |
+-------------------------+-------------------------+
| innodb_version | 5.7.19 |
| protocol_version | 10 |
| slave_type_conversions | |
| tls_version | TLSv1,TLSv1.1 |
| version | 5.7.19-0ubuntu0.16.04.1 |
| version_comment | (Ubuntu) |
| version_compile_machine | x86_64 |
| version_compile_os | Linux |
+-------------------------+-------------------------+
8 rows in set (0,01 sec)
as per cakephp/cakephp#13052
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.