ceceppa / ceceppa-multilingua Goto Github PK
View Code? Open in Web Editor NEWCeceppa Multilingua: Multilingual plugin for Wordpress
License: GNU General Public License v3.0
Ceceppa Multilingua: Multilingual plugin for Wordpress
License: GNU General Public License v3.0
I've found a bug, when editing theme translations and you enable more than one language.
The keys of textareas are wrong so when submit the form, translations are saved in the correct lang, but in the wrong string.
I've found what I believe it's cause of it. In file po-parser.php, line 257, I've moved out of the foreach the $id incrementation:
Changing this:
$id++;
} //foreach
For this:
} //foreach
$id++;
I do not perform an exhaustive check, but at least with this change theme translation works ok.
This query takes ages to be executed and the result is the website takes like 30 seconds to be loaded.
SELECT DISTINCT meta_value, posts.ID, post_title
FROM wp_ceceppa_ml_relations as cc, wp_posts posts, wp_postmeta as postmeta
WHERE postmeta.meta_key='post_views_count' AND
postmeta.post_id = posts.ID AND
post_type='post' AND
post_status = 'publish' AND
cc.lang_1 = posts.ID
ORDER BY CAST(meta_value AS DECIMAL) DESC
LIMIT 0 , 4
We have indexed the field lang_1 and it's a little bit faster.
Can you have a look please?
in the html is not inserted the url for the feed category :-/
And the link doesn't work, they redirect to the first post that contain the terms
Also in the header the url is missing ex: https://mte90.net/mozilla/
On click to add new post in other language the categories are not copied from the original, maybe is the same problem of
#33
cml_show_flags(array('only_existings' => true))
As you can see on http://www.mte90.net/ the last news (Promote MDN) have italian and english flag but have only a language, the english.
Se you see the site in english is showed the italian link but not the english.
The metabox of Wp Seo by yoast have a little problem of alignment of tabs created by the file admins.css on line 454:
.advanced {
background: none repeat scroll 0% 0% #FFF;
cursor: default !important;
overflow: hidden;
transition: all 0.2s ease-in-out 0s;
display: block !important;
}
The problem is display block
In Api.php and api.old.php
all occurencies of
,,,
CML_UPLOAD_URL . "/$size/$flag.png"
,,,
need to be replace with
,,,
CML_UPLOAD_URL . "$size/$flag.png"
,,,
otherwise the image url has a double // before image size, cause the trailing slash is already appended to CML_UPLOAD_URL .
I know this is a small issue but give URL error with scraping tool for SEO purpose.
Could you please change the next line in \ceceppa-multilingua\admin\admin-posts.php on line 409
FROM
'post_author' => get_current_user_id(),
TO
'post_author' => $_POST['post_author'],
?
Cause after creating/updating post - author sets as user you are logged in instead of post author.
One cool feature for SEO would be to remove defalut "category" slug that WP prepend to category URL.
Since you have added the chance to translate "category" word in other languages, SEO Yoast option that remove the word doesn't work anymore.
Here it is some WP rewrite rules that I use to remove "category" word from category urls.
It has to be updated because it only manage 2 langs:
add_filter( 'category_rewrite_rules', 'filter_category_rewrite_rules' );
function filter_category_rewrite_rules( $rules ) {
global $wpdb;
$categories = get_categories( array( 'hide_empty' => false ) );
if ( is_array( $categories ) && ! empty( $categories ) ) {
$slugs = array();
$slugs_en = array();
foreach ( $categories as $category ) {
$it='';
$en='';
if ( is_object( $category ) && ! is_wp_error( $category ) ) {
if ( 0 == $category->category_parent ):
$slugs[] = $category->slug;
$en = $wpdb->get_var( "SELECT UNHEX(cml_cat_translation_slug) FROM wp_ceceppa_ml_cats WHERE cml_cat_id=".$category->term_id );
$slugs_en[] = $en;
else:
$it=trim( get_category_parents( $category->term_id, false, '/', true ), '/' );
$slugs[] = $it;
$it_slugs= explode ( '/', $it );
foreach ($it_slugs as $it_slug) :
$cat=get_category_by_slug( $it_slug );
$en .= $wpdb->get_var( "SELECT UNHEX(cml_cat_translation_slug) FROM wp_ceceppa_ml_cats WHERE cml_cat_id=".$cat->term_id ) . '/';
endforeach;
$slugs_en[] = trim($en, '/' );
endif;
}
}
if ( ! empty( $slugs ) ) {
$rules = array();
foreach ( $slugs as $slug ) {
$rules[ '(' . $slug . ')/feed/(feed|rdf|rss|rss2|atom)?/?$' ] = 'index.php?category_name=$matches[1]&feed=$matches[2]';
$rules[ '(' . $slug . ')/(feed|rdf|rss|rss2|atom)/?$' ] = 'index.php?category_name=$matches[1]&feed=$matches[2]';
$rules[ '(' . $slug . ')(/page/(\d)+/?)?$' ] = 'index.php?category_name=$matches[1]&paged=$matches[3]';
}
foreach ( $slugs_en as $slug_en ) {
$rules[ '(' . $slug_en . ')/feed/(feed|rdf|rss|rss2|atom)?/?$' ] = 'index.php?category_name=$matches[1]&feed=$matches[2]';
$rules[ '(' . $slug_en . ')/(feed|rdf|rss|rss2|atom)/?$' ] = 'index.php?category_name=$matches[1]&feed=$matches[2]';
$rules[ '(' . $slug_en . ')(/page/(\d)+/?)?$' ] = 'index.php?category_name=$matches[1]&paged=$matches[3]';
}
}
}
return $rules;
}
SEO Yoast now work great with CECEPPA.
The only issue I found is in generated xml sitemap.
Category sitemap contains only original language category url and not translated ones.
Hi,
I have translated a page called "Hostel" with the plugin.
The url por spanish version is www.domain.com/hostel and the url for the english is www.domain.com/en/hostel-2
The problem is that when I go to the url www.domain.com/hostel and click on the english flag, the URL changes to ww.domain.com/en/hostel but it stills show the spanish version..
I am using the version 1.5.16 of the plugin and Worpress 4.5.2.
After upgrade to version 1.5.13 my site is broken, I don't have rights to access admin.php?page=ceceppaml-language-page, slugs don't works etc.
Catchable fatal error: Object of class WP_Error could not be converted to string in wp-content/plugins/woocommerce/includes/wc-template-functions.php on line 561
Woocommerce Version: 2.5.2
Wordpress Version: 4.4.1
Ceceppa Multilingua support for Woocommerce Verision: 0.8
It's a small bug according changes 0a0ed4a In menu I have added item "All languages except current" and there I have URL "http://domain/tld/en" - should be "http://domain/tld/en/".
In the page on the backend for set the translated page if the page to assign have the same language of the post in editing it's showed in the dropdown and if have the same name it's impossible reconize the correct page.
I think that in this list the page in editing it's been removed.
On the save of a new post in the other language and the setting of the other post in the other language on the save is not saved.
I've to do that many times before that he save that option.
Actually they are all showed with a link for that page only with the language slug.
After activation this plugin I have problem with resetting the chosen static page displayed as front page of my site (options-reading.php). In option "Front page displays" I have chosen "A static page (select below)" and selected page in "Front page", "Posts page" is blank. From time to time the "Front page" option is resets and chosen random a static page. I have this issue on my all page with ceceppa.
The language prepath seems to disappear upon changing the slug for a post or page.
Example: http://www.url.com/en/sample-page/, change slug to 'test-page', turns into http://www.url.com/test-page/
It would be great if the comments could translated into English to ease understanding of the code.
Ciao Alessandro, qui il fix al problema:
if( is_array( $seo ) ) {
$page = isset($_POST['page']) ? $_POST['page'] : '';
foreach( $seo as $s ) {
if( $s[ 'pagenow' ] == $pagenow ) {
if( isset( $s[ 'page' ] ) && $s[ 'page' ] != $page ) {
break;
}
CMLUtils::_set( "translate_home", 1 );
CMLUtils::_set( '_real_language', CMLLanguage::get_default_id() );
}
}
}
It would be great to be able to have same slugs under different languages. Say a name or word as a title which would be the same in two or more languages.
Example: English - /en/fusion-implementation/, German - /de/fusion-implementation/
Sometimes a unexpected behaviour appears in post relations.
It happens that post and translated post are no more related and to link them only way is to modify relation in wp_ceceppa_ml_relations table in database.
I can't clearly understand when it happens.
Sometimes static homepage link in flags are not displaying correctly.
It happens that post slug is appended to the url (while it should have to be like www.siteurl.com/en for example).
Or sometimes ?lang=slug is appended.
Sometimes link are correct but when you are in translated lang homepage flag link are wrong for same page. Example: page is www.siteurl.com/en and english flag link is www.siteurl.com/en/postslug.
I can't success in discover why and when it happens, but I think I found an error in frontend/utils.php on line 33:
foreach( array( $pfp, $pof ) as $id ) {
//$t = CMLPost::get_translations( $pfp );
$t = CMLPost::get_translations( $id );
(wrong line commented and suggested correction on next line).
I get this error in advanced view form the settings in the quick edit mode panel for every cpt
Warning: in_array() expects parameter 2 to be array, string given in /data/vhosts/mte90.net/httpdocs/wp-content/plugins/ceceppa-multilingua/admin/layouts/options-advanced.php on line 35
There is a problem with Customize - is not working when we click to Appearance > Customize from backend, in browser network debugger I see "302 Not found" message for my site URL without language slug. Customize only work when we go to it from frontend - then URL is like that: http://domain.tld/wp-admin/customize.php?url=https%3A%2F%2Fdomain.tld%2Fen%2F. Of course problem doesn't exist when I turn off ceceppa-multilingua plugin.
The problem is visible on http://www.mte90.net/, in the italian/english link that point to the home page for every link
Hi
I'm using Ceceppa rel. 1.5.17 on WordPress 4.7.5
I've configured Italian as default language, with English as second language
if I try to publish a post with both languages, I experience the following error
In advanced settings, I've checked following option, but server error always happens
any hint?
thanks in advance
When using Ceceppa multilang with SEO Yoast and set homepage as list of latest articles there is no way to translate metadata (metatitle, metadesc and og metadata).
In every translated version WP always use original language metadata.
I can't edit permalink options - I have PHP fatal error in /wp-admin/options-permalink.php after update the plugin:
Warning: require_once(/home/xxx/domains/xxx/public_html/wp-content/plugins/ceceppa-multilingua/admin/admin-permalink.php): failed to open stream: No such file or directory in /home/xxx/domains/xxx/public_html/wp-content/plugins/ceceppa-multilingua/admin/admin.php on line 124
Fatal error: require_once(): Failed opening required '/home/xxx/domains/xxx/public_html/wp-content/plugins/ceceppa-multilingua/admin/admin-permalink.php' (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/xxx/domains/xxx/public_html/wp-content/plugins/ceceppa-multilingua/admin/admin.php on line 124
Hi mate, I'm here just to give you a suggestion of improvement for the future. On our site we have 9 pages of strings in "My Translations" and finding a string to edit starts to be really hard. Would be nice to have a search box on top of the "My Translations" page.
Thanks for your work!
Plugin loads some JS files (../ceceppa-multilingua/js/ceceppaml.js + jquery) in header which slows down website. Could You change it to load this files in footer?
Ciao Alessandro, appena attivato su nuovo sito mi ha dato questo errore, di solito è causato da uno spazio dopo la chiusura del php ?>, io ho trovato che potrebbe essere nel file settings.php, eliminando lo spazio non mi è più capitato.
Eventualmente puoi non chiudere i file php.
Ciao
There is a problem with slug on front page - with Ceceppa I have 2 URLs for one language:
http://domain.tld/en
http://domain.tld/en/
This two links are not good for SEO. I try to configure permalinks to remove first one but with not luck.
Especially on get_translations
that in my homepage is executed 25 with 25 queries...
I have enabled SSL in dashboard and with ceceppa-multilingua plugin I have problem with secure because plugin always added unsecure URL to CSS:
`
`Problem disappeared when I uncommented line for definition CML PLUGIN CACHE URL:
define( 'CML_PLUGIN_CACHE_URL', CML_PLUGIN_URL . trailingslashit ( 'cache' ) );
and commented second definition:
define( 'CML_PLUGIN_CACHE_URL', CML_UPLOAD_URL . trailingslashit ( 'cache' ) );
Please fix it.
When you publish or update a page, the return url is not the pages list but the post (article) list.
Noticed that slugs converted from the translated names are incorrect.
Example: CML translates 'Tür' to 'tur' and WordPress does 'Tür' to 'tuer'. (The latter one being correct.)
This corrupts the taxonomy links in the posts and pages.
It might be an idea to add another set of language fields for the slug as well. That way a custom slug for the different languages can be defined.
(This is probably a bug (wrong translation) + feature (custom slug per language).)
@ceceppa è possibile usare lo short code
[:en]English text here.[/:en]
[:ar]Arabic text here[/:ar]
nel excerpt? Ho provato ma sembra non funzionare. Sarebbe molto utile per noi, pensi di poterlo aggiungere?
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.