Skip to content

Commit 926e43c

Browse files
committed
Add README.MD
1 parent 2b1d3a7 commit 926e43c

File tree

2 files changed

+127
-0
lines changed

2 files changed

+127
-0
lines changed

.github/banner-github.png

25.7 KB
Loading

README.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
<a href="https://beapi.fr">![Be API Github Banner](.github/banner-github.png)</a>
2+
3+
# Simple Punctual Translation
4+
5+
A plugin for WordPress that allow to translate any post type in another languages. Translate only the single view.
6+
7+
## Description
8+
9+
A plugin for WordPress that allow to translate any post type in another languages.
10+
11+
The user features can be summarized in the ability to switch between multiple languages and on the single view of content. Thus, a page can be translated in X languages.
12+
13+
The architecture chosen for development is fully consistent with WordPress 3.0, we created a content type translation, and we created a taxonomy for the site languages.
14+
We customized the WordPress admin console to provide the translation functionality, a bit of AJAX to make the convenient interface. Finally, we created a widget that displays the languages available for the currently loaded content.
15+
16+
A translator role is automatically created with the plugin, it allows a user to this role only to create and manage translations.
17+
18+
The plugin offers settings:
19+
20+
* Automatic insertion of languages available to the end of the article
21+
* Language detection URL : via a "lang" parameter in the address or via a prefix beginning of the address:
22+
* http://www.herewithme.fr/contenu/?lang=de
23+
* or http://www.herewithme.fr/de/contenu
24+
* Enabling translations on their choice of post types
25+
* 2 modes for the translation mechanism, which I will explain in FAQ.
26+
27+
## Frequently Asked Questions
28+
29+
### What differences between the 2 translation engines ?
30+
31+
For this plugin, we did not impose an architecture defined for the translation engine, so we proposed an automatic or manual mode.
32+
33+
**Automatic mode**
34+
35+
The automatic mode is rather aimed at the general public, because no change is necessary in the source code. The idea is that, when sailing on the German version of a page, WordPress retrieves data from the original page, and our plugin is automatically injected the contents of German 3 fields, title, content and extract .
36+
This means that the German version in automatic mode will keep, if your theme display it, publication date, comments, author, tags and categories of the original post.
37+
This mode is quite sufficient to use the basic translation plugin on content types native, it is compatible to 99% on the existing WordPress installations.
38+
39+
**Manual mode**
40+
41+
This second mode is much more powerful than the first. The manual mode does not modify any data from the initial query of WordPress, so no modification is made on the theme, your content will not even be translated! To switch language, we were inspired by functions of WordPress Mu allowing switch between blogs, either `switch_to_blog()` and `restore_current_blog()`.
42+
And we have created 2 functions `switch_to_language()` and `restore_original_language()`.
43+
44+
The first function `switch_to_language()` toggles the content in the translated version, while the second function `restore_original_language()` allow to restore the original language of the content.
45+
46+
Example :
47+
48+
`<?php
49+
the_title(); // Title in English
50+
51+
switch_to_language();
52+
the_title(); // Title in French
53+
restore_original_language();
54+
55+
the_title(); // Title in English
56+
?>`
57+
58+
This pair of functions allows developers to be extremely precise about which fields to translate. This mode in my opinion, should be widely preferred because it is clean, it does not interact with the original application of WordPress. Nevertheless, there are some flaws such as:
59+
60+
* The title page's HTML is not translated
61+
* Plugins breadcrumb does not take into account the translation
62+
63+
These are mainly defects on the SEO aspect, and indeed on this first version of the plugin that we have worked the functional aspect. We rely on community feedback to improve the plugin ...
64+
65+
## Requirements
66+
67+
**Required PHP5.**
68+
69+
## Installation
70+
71+
The Simple Punctual Translation can be installed in 3 easy steps:
72+
73+
1. Unzip "Simple Punctual Translations" archive and put all files into your "plugins" folder (/wp-content/plugins/) or to create a sub directory into the plugins folder (recommanded), like /wp-content/plugins/simple-punctual-translation/
74+
2. Activate the plugin
75+
3. Inside the Wordpress admin, go to Options > Translations, adjust the parameters according to your needs, and save them.
76+
77+
## Screenshots
78+
79+
2. Settings page
80+
3. Translations post type admin
81+
4. Menu translations
82+
5. Meta box for original content
83+
6. Meta boxes for translation. Allow to choose the original content.
84+
7. Widget settings
85+
86+
## Who ?
87+
88+
Created by [Be API](https://beapi.fr), the French WordPress leader agency since 2009. Based in Paris, we are more than 30 people and always [hiring](https://beapi.workable.com) some fun and talented guys. So we will be pleased to work with you.
89+
90+
This plugin is only maintained, which means we do not guarantee some free support. Consider reporting an [issue](#issues--features-request--proposal) and be patient.
91+
92+
If you really like what we do or want to thank us for our quick work, feel free to [donate](https://www.paypal.me/BeAPI) as much as you want / can, even 1€ is a great gift for buying cofee :)
93+
94+
95+
## Changelog
96+
97+
* Version 1.1.4 :
98+
* Fix wrong condition on save_post
99+
* Version 1.1.3 :
100+
* Fix translate select dropdown query
101+
* Version 1.1.2 :
102+
* Fix infinite redirect for rest API & WP-Cli
103+
* Version 1.1.1 :
104+
* Fix error for not available roles
105+
* Version 1.1.0 :
106+
* Put all constructors on __construct
107+
* Remove useless not working code
108+
* Add quality tools
109+
* Remove create_function
110+
* Fix code style
111+
* Fix some translation strings missing
112+
* Version 1.0.5 :
113+
* Fix notice / sql error on 404 page
114+
* Version 1.0.4 :
115+
* Use method __construct() for Widget Constructor
116+
* Version 1.0.3 :
117+
* Fix preview link on admin
118+
* Version 1.0.2 :
119+
* Add french translation
120+
* Add readme.txt
121+
* Add screenshots
122+
* Fix a bug with protection of post_parent with quick edit
123+
* Version 1.0.1 :
124+
* Fix some PHP typos
125+
* Version 1.0
126+
* Initial version
127+

0 commit comments

Comments
 (0)