4D v11 Resource Architecture
10/10/08 20:37 Filed in: 4D Summit
2008
Resource
Architecture in 4D v11:
Jesse Pina
Resource Fork Limitations:
- Rigidly Structures, need external editors, etc.
- Contents not viewed easily
- Limits on size of files
- Poor image quality
Benefits of New Architecture:
- Flexible
- Transparent
- Open Standard
- Scalable
Take a look at the “Hotel 4D” database to see some examples of how resources are used. Resources are good for;
- Localizing
- Customizing the look and feel of an application for different audiences. Drop in logo images, custom strings and the application will change without any coding or recompiling.
XLIFF:
XML Labguage Interchage File Format - Accepted Standard for handling strings, text, and formats (which are basically strings)
Reference from 4D:
- :15000,1 Traditional
- xliff:string resource name - resname element from the XLIFF file
- create a 2nd group tag in the XLIFF file, match the resname elements with the Form and Object names in 4D. No reference in 4D is required.
.lproj folders:
Three conventions for the first part of the .lproj folders in the Resources Folder.
- ISO639-1 (most common, en or fr)
- RFC 3066 BIS (more specific/granular)
- Legacy (english or french)
Load sequence:
OS Language
4D Application Language
English
First Valid .lproj folder
Images:
Use the syntax: “file:images:image.jpg” to refer to the image.
Drag & Drop is supported.
If you put an image in the .lproj folder, it will change dynamically with the loaded language. You can still provide the complete path to a desired .lproj folder and the path will not resound to the localization (i.e. show an Italian flag on a machine running US OS language.
Client Server:
Resources are copied locally.
Three options to have resources refreshed
- Never: must logout & login to download new resources
- Always: 2 minutes after the changes have been commited by the client.
- Ask: Client that modified the resource can choose to notify the clients. Clients will be able to accept or decline the changes. Once the other clients log out & back in they will get the new resources.
The intended behavior is that only the modified file is pushed out to the clients. Someone said that the entire resurces file was re-downloaded when a change w made.
Conversion/Compatibility:
You are still allowed to place your localized strings into the plugin bundle. References will still work.
Jesse Pina
Resource Fork Limitations:
- Rigidly Structures, need external editors, etc.
- Contents not viewed easily
- Limits on size of files
- Poor image quality
Benefits of New Architecture:
- Flexible
- Transparent
- Open Standard
- Scalable
Take a look at the “Hotel 4D” database to see some examples of how resources are used. Resources are good for;
- Localizing
- Customizing the look and feel of an application for different audiences. Drop in logo images, custom strings and the application will change without any coding or recompiling.
XLIFF:
XML Labguage Interchage File Format - Accepted Standard for handling strings, text, and formats (which are basically strings)
Reference from 4D:
- :15000,1 Traditional
- xliff:string resource name - resname element from the XLIFF file
- create a 2nd group tag in the XLIFF file, match the resname elements with the Form and Object names in 4D. No reference in 4D is required.
.lproj folders:
Three conventions for the first part of the .lproj folders in the Resources Folder.
- ISO639-1 (most common, en or fr)
- RFC 3066 BIS (more specific/granular)
- Legacy (english or french)
Load sequence:
OS Language
4D Application Language
English
First Valid .lproj folder
Images:
Use the syntax: “file:images:image.jpg” to refer to the image.
Drag & Drop is supported.
If you put an image in the .lproj folder, it will change dynamically with the loaded language. You can still provide the complete path to a desired .lproj folder and the path will not resound to the localization (i.e. show an Italian flag on a machine running US OS language.
Client Server:
Resources are copied locally.
Three options to have resources refreshed
- Never: must logout & login to download new resources
- Always: 2 minutes after the changes have been commited by the client.
- Ask: Client that modified the resource can choose to notify the clients. Clients will be able to accept or decline the changes. Once the other clients log out & back in they will get the new resources.
The intended behavior is that only the modified file is pushed out to the clients. Someone said that the entire resurces file was re-downloaded when a change w made.
Conversion/Compatibility:
You are still allowed to place your localized strings into the plugin bundle. References will still work.