actions.ini for each table and default language

A place for users and developers of the Xataface to discuss and receive support.

actions.ini for each table and default language

Postby meta » Tue Jun 17, 2008 5:51 am

Hi steve,

when having no customized actions.ini in my app I will get the german translation of buttons etc. according to my browsers language configuration, right?

Now I tried to have one own actions.ini for each of my apps tables so that I can customize some tabs, actions etc.

After doing so, I got the buttons all in english again. What can I do to have german as a default language for all of my apps tables?

Thank you
Markus
meta
 
Posts: 30
Joined: Mon Nov 12, 2007 8:30 am
Location: Berlin, Germany

Postby Jean » Tue Jun 17, 2008 5:58 am

Hi Markus,

Did you try to add
Code: Select all
[languages]
de = de


in your conf.ini ?

Jean
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Postby meta » Tue Jun 17, 2008 7:08 am

Jean wrote:Hi Markus,

Did you try to add
Code: Select all
[languages]
de = de


in your conf.ini ?

Jean


Hi Jean,

yes I tried but it won't work :(

Thank you anyway. Any more Ideas?
Markus
meta
 
Posts: 30
Joined: Mon Nov 12, 2007 8:30 am
Location: Berlin, Germany

Postby shannah » Tue Jun 17, 2008 8:31 am

Can you give me an example of one of the actions that you have customized that causes the problem? (e.g. the actions.ini entry)
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby meta » Tue Jun 17, 2008 9:20 am

shannah wrote:Can you give me an example of one of the actions that you have customized that causes the problem? (e.g. the actions.ini entry)


Hi steve,

thank you for your quick reply. I have not customized anything yet. I just copied the original actions.ini from my XF-directory directly into my tables-Directories. So it looks like this:




Code: Select all
;;------------------------------------------------------------------------------
;; Table tabs
;; -----------
;;
;; The table tabs are the little tabs ('details', 'list', 'find', ...) at the top
;; of the screen.

;; Show the details of the current record
[browse]
   label = Details
   category = table_tabs
   url = "{$this->url('-action=view')}"
   accessKey = "b"
   mode = browse
   permission = view
   order=0

;; Show a list of the records in the current found set
[list]
   label = List
   category = table_tabs
   url = "{$this->url('-action=list')}"
   accessKey = "l"
   mode = list
   template = Dataface_List_View.html
   permission = list
   order=0.5

and so on...



Did I do it the right way or do I have to have a subdirectory actions in my apps table directories?

Thank you
Markus
meta
 
Posts: 30
Joined: Mon Nov 12, 2007 8:30 am
Location: Berlin, Germany

Postby shannah » Tue Jun 17, 2008 10:45 am

The method that you used will actually replace the entire action. It is better to just extend the action and change the parts that you want to change. You can extend an action with this syntax:

Code: Select all
[actionname > actionname]


e.g. if you just wanted to change the order of the browse action:
Code: Select all
[browse > browse]
    order=10


This way the settings such as the label of the browse action won't be overwritten and you should be able to maintain internationalization.

(Theoretically your method should still work - but I'll have to look into why its not picking the translation).

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby meta » Wed Jun 18, 2008 4:00 am

Hi Steve,

it works. Thank you.

Normally I thought it should be like this:

All parameters in path/to/myapp/tables/mytable/actions.ini are executed FIRST

The same parameters in path/to/myapp/actions.ini AND/OR
in path/to/xataface/actions.ini are overwritten.

All parameters in path/to/myapp/actions.ini are executed SECOND
The same parameters in path/to/xataface/actions.ini are overwritten.

All parameters in path/to/xataface/actions.ini are executed THIRD.

I have it so that I have an actions.ini per table, NO actions.ini in path/to/myapp/ and the standard actions.ini in path/to/xataface/

I wonder how the translation process works when I use your solution and in general? It's just my curiosity and trying to better understand your framework.

Markus
meta
 
Posts: 30
Joined: Mon Nov 12, 2007 8:30 am
Location: Berlin, Germany

Postby shannah » Wed Jun 18, 2008 7:42 pm

Hi Markus,

The way that you describe would be nice - but it doesn't quite work that way.
If you define an action in any actions.ini file, it will erase any action that has been defined previously. If you want to extend a previous action you use the syntax:
[myaction > parentaction]

So in your case you were overriding the browse action with another action named browse
[browse > browse]

The good thing about this is that if you want to completely erase an action, you can just add an empty action to your actions.ini file with the same name.

e.g. adding
[browse]

to your actions.ini file would remove the browse tab completely.

It does load in the order that you suspect, though:

app/tables/.../actions.ini
app/actions.ini
dataface/actions.ini

etc..

However it appears that perhaps I haven't added the localisation for labels defined in the table level actions.ini files... this is a bug that I'll look into when I get a chance .

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby meta » Thu Jun 19, 2008 8:14 am

Thank you Steve. I think I can work with it.

Greets
Markus
meta
 
Posts: 30
Joined: Mon Nov 12, 2007 8:30 am
Location: Berlin, Germany


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 24 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved