Hi,
The developer of Twig have made an i18n-extension.
Download the latest Twig Sanpshot: git://github.com/fabpot/Twig.git
Or use this code-snippet (what I've done):
<?php
class Gettext_Twig_Extension extends Twig_Extension
{
public function getFilters()
{
return array(
't' => new Twig_Filter_Function('gettext'),
);
}
}
/*
$twig = new Twig_Environment(...);
$twig->addExtension('Gettext_Twig_Extension.class.php');
{{ 'MY_USERNAME'|t }} can now be used in templates to display the
gettext string associated with the "MY_USERNAME" key.
*/
Am 15.03.2010 13:29, schrieb Tomas Srnka:
> Hi,
>
> could you please publish the filter somewhere? There is a message in
> TWIG's mailing list without any reply regarding gettext and I'm
> planning to use TWIG+gettext in my own project.
>
> Thank you!
>
> Best regards,
> Tomas Srnka
>
> On Mon, Mar 15, 2010 at 12:29 PM, Michael Keck <sfnet(a)michaelkeck.de
> <mailto:sfnet@michaelkeck.de>> wrote:
>
> Hi Michal,
>
> I've found a solution and it worked for me now:
> I've contacted the developer of TWIG and he gives me a sample
> filter for
> gettext. So I can use in templates as an expample {{ 'Welcome to
> phpMyAdmin'|t }}.
>
> I know, that phpMyAdmin should still work without javascript.
> Javascript
> should only be a feature. But if user want to use javascript, this
> should be secure enough.
>
> I guess with you, that with wrong encoding/charset in browser settings
> also text in pages may be displayed wrong, but phpMyAdmin still works.
> Perhabs I will see 'L?schen' instead of 'Löschen', but it still works.
> But it's different in javascript (I've written many javascripts in
> past):
> With wrong encoding/charset in browser settings, you'll get 'Löschen'
> (or something other terrible for javascript like 'ä' for the letter
> 'ä') for the string 'Löschen', which crashes all used javascripts.
> With my "bulletproof"-suggestion (using 'L\u00F6schen' instead of
> 'Löschen'), only the text is displayed wrong (I will see
> 'L\u00F6schen'
> or 'L?schen' instead 'Löschen'), but javascript still working.
>
> Regards
> Michael
>
> ------------------------------------------------------------------------------
> Download Intel® Parallel Studio Eval
> Try the new software tools for yourself. Speed compiling, find bugs
> proactively, and fine-tune applications for parallel performance.
> See why Intel Parallel Studio got high marks during beta.
> http://p.sf.net/sfu/intel-sw-dev
> _______________________________________________
> Phpmyadmin-devel mailing list
> Phpmyadmin-devel(a)lists.sourceforge.net
> <mailto:Phpmyadmin-devel@lists.sourceforge.net>
> https://lists.sourceforge.net/lists/listinfo/phpmyadmin-devel
>
>
Hi,
I want to welcome Dieter Adrianssens from Belgium to our team. Maybe
he'll want to introduce himself on this list.
--
Marc Delisle
http://infomarc.info
Hi all
there is new branch called gettext in git repository. The code is
really not ready for merging (at least some fixups to po files are
needed), but if you want, you can test it right now.
After checkout you need to generate .mo files which gettext loads and
you can do it using scripts/generatemo. Afterwards at least these
translations which do not have broken po files should work.
--
Michal Čihař | http://cihar.com | http://blog.cihar.com
Hi,
I suggest to deactivate SVN, to avoid the situation where someone still
reads it, therefore getting an old state of development.
--
Marc Delisle
http://infomarc.info
Hi, all.
I'm trying to make enum and set editors
(https://sourceforge.net/tracker/index.php?func=detail&aid=1494550&group_id=…).
I added the special button near text input (see attachment
enum-button.png). When you click on the button, editor dialog are
shown.
And i have a question about possibility of using jquery ui dialog for this.
In js/ folder i'm seeing only mootols js-framework.
And i made custom dialog for enum editor (see attachment enum-editor.png).
But i think that jquery ui dialog is better solution for this task
(http://jqueryui.com/demos/dialog/modal-form.html).
What do you think?
Best regards. Pavel Konnikov
Hi
the deadline for GSoC 2010 application is this Friday. I've just
updated application on wiki to match this year questions:
http://wiki.phpmyadmin.net/pma/GSoC_2010_Application
Please go through it and make an improvements so that we have great
application which will be accepted ;-).
PS: Marc, I need your link id (you've chosen this when registering to
GSoC website).
--
Michal Čihař | http://cihar.com | http://blog.cihar.com
Hi!
Thanks for your reply Marc, I'm back with some idea for this GSoC project now .
Instead of directly talking about PHP OOP architecture, I would like to speak REST architecture style firstly. I designed and developed a RESTful web service for the last company I worked for as an intern (4th french online shoes shop), and I developed a PHP RESTful proxy.
Beyond the buzzword, it's a well-organized and extensible architecture, that fits very well with PMA. PMA is seen as a GUI that helps manage a MySQL server, but it also can be seen as a web service (disguised beneath a GUI though), transferring and building comprehensive data between the MySQL server and a end user. Plus, relational data is very prone to be REST oriented.
Why should one consider PMA as a REST oriented app ?
-Client/Server architecture
PMA is the client of an underlying application, MySQL, querying on behalf of the user.
- Resources
Everything that comes from the server and the user work with (CRUD) can be considered as a resource : a table, a row, a user ...
SQL queries change the state of theses resources, switching them into a new state.
- Uniform interface
CRUD operations in DBMS are similar in nature to what HTTP methods do to resources (GET/SELECT, POST/INSERT, DELETE/DELETE, PUT/UPDATE ...).
- Resource representations
Dumping data from a table is basically dumping the application state : one can select the representation he wants : CSV, LaTeX, XML, PDF ...
-URIs & Stateless
Clean URIs such as /tables/myapp/users?first_name=Elvis&last_name=Presley are easily bookmark-able due to their stateless structure, and editable by experienced users via the browser's address bar for fast and simple access. Obviously it can support SQL queries and representation types like /tables/myapp?query="SELECT * FROM users WHERE first_name='Elvis' AND last_name='Presley'"&output=xml. In this example, since a URL is fetched via GET, only SELECT statement should be allowed (DESCRIBE too, but querying via URL is just a utility tool, not a full API).
There is some points on which PMA cannot be RESTful (REST oriented is enough), since it cannot handle cacheability (we need live data) and maybe some others I miss since I do not know every internal requirements.
That was my thoughts on the non-code oriented architecture topic. Now let's move on PHP ;)
Should the new architecture be PHP 5.3 compatible and leverage its new functionalities ? As you now, Zend and Sensio headed their frameworks' next major version toward PHP 5.3. What are your plans about it ? (PMA 3 being young)
Currently, PHP code is very tied to HTML code and no template solution is used. GSoC proposal says it should be easier to create new templates, so maybe we should start with a simple template engine (existing or home made) that users can learn easily. Pro and cons should considered : home made template may be faster and better integrated, but users have to learn it and documentation has to be written for example ... This separation of concerns leads to MVC architecture, which is currently the best architectural pattern for PHP web based app.
Whatever happens, an OOP structure for PMA means a big rewriting of its codebase if I'm not wrong (although some classes are already in the place) . A modular approach, with low coupling components (observer pattern, maybe DI ?) should allow code reusability and easy plugin development.
Concerning mysql drivers, what are your minds on PDO ? Actually mysql_* and mysqli_* are the two interfaces used. PDO offers some nice features (prepared statements) for an OO environment (Exceptions) and some little tiny ORM possibilities (Object hydratation-like with fetchObject).
Finally, testing could be introduced, to ensure only error free code is committed (not saying you commit code with errors :p) and that it won't break any existing functionality.
I hope my ideas is not too far away from your expectations, and that some of them will grasp your attention.
Regards,
Edouard