Comments (9)
sorry to reopen this again but if you have more then one application(with language uri) won't work
for site app you have domain.com/en/controller/method/etc
for test app it becomes domain.com/test/en/controller/method/etc instead of domain.com/en/test/controller/method/etc
or this is intended behavior ?
from starter-public-edition-4.
http://domain.com/test/ is the base URL of the application. After it the language identificator comes. I don't see a problem.
http://domain.com/en/test/ - actually with this URL you will get into the default application.
I suppose, inside .htaccess you may try to translate /test/en/ -> /en/test/ , but I don't see a serious reason why is that necessary, especially when the second application is for administration purposes.
from starter-public-edition-4.
in terms of application i was thinking more like
site app - cms
forum app - forum
admin - admin
so domain.com/en/forum is nicer then domain/forum/en/
guess i will have to keep forum as a module inside site app
i will try to get a solution for this because i like the idea of multiple (more then 2) applications
from starter-public-edition-4.
Better don't make the forum as a separate application. It can be a module, why not. If you generate sitemap.xml this would be easier for one public application. Also, when a user logs in the site, all the special features for a logged user, including in the forum would be accessible. You will avoid some duplicate efforts for visual design.
With this particular platform I have no a real site yet. It would happen at the end of this year. I see the following picture:
http://example.com/ - the public site
http://example.com/admin/ - the administration site
http://example.com/services/ - web services (RESTfull maybe), for banner exchange, advertizing, etc.
http://example.com/en/module/controller/method
http://example.com/application2/en/module/controller/method
http://example.com/application3/en/module/controller/method
This is what I intend to stay as a default behavior. Also, I implemented the language URI only for the default application intentionally. If you want this for all the applications you can port corresponding code within the platform/core/common/ folder.
from starter-public-edition-4.
ok no problem i will implement my own solution
on question i tried to get lang in core_config
$CI =& get_instance();
if (isset($CI->lang) && is_object($CI->lang)) {}
the condition fails any way to load lang lib ?
should i just add the relevant code in my_config and my_lang files (inside platform\core\common\core) or core_config and core_lang ?
from starter-public-edition-4.
The original fragment was:
if (function_exists('get_instance'))
{
$CI =& get_instance();
$uri = $CI->lang->localized($uri);
}
https://github.com/EllisLab/CodeIgniter/wiki/CodeIgniter-2.1-internationalization-i18n
I suppose, this check is necessary, because site_ulr() might be called before the core has been fully loaded.
Due to my rearrangement in the bootstrap code and to suppress the error "calling a method of non-object", I extended this check this way:
if (function_exists('get_instance'))
{
$CI =& get_instance();
if (isset($CI->lang) && is_object($CI->lang)) {
$uri = $CI->lang->localized($uri);
}
}
When the core is loaded at certain stage, the condition does not fail and $uri = $CI->lang->localized($uri); gets callable.
I recommend for the moment you just to copy/paste language URI relevant code to the relevant applications that require this feature. I know, this is ugly.
It would be good this code to be integrated within the common "application", but additional setting for enabling/disabling this feature is required then. I don't like these hard-coded settings in the original code - some new configuration options should be created. When I have time, I'll polish this code and I'll move it within the common "application".
from starter-public-edition-4.
ok thanks a lot and sorry to be a bore
from starter-public-edition-4.
No problem at all.
from starter-public-edition-4.
@quasiperfect
I reworked internationalization totally, I think, its quality is good now.
from starter-public-edition-4.
Related Issues (20)
- PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212/msql.so HOT 4
- Plans for 4.4 HOT 8
- Where is "Support for database stored settings (Settings library)." database? HOT 2
- $this->uri->segments() should not return the language segment. HOT 2
- db question HOT 7
- email config HOT 5
- Deleting Cache Dir HOT 5
- different language for applications HOT 3
- Read the language settings from the database HOT 3
- multiple applications HOT 2
- Notes: Advanced CRUD using DataTables, a visual sample
- Email templates and global XSS filtering HOT 1
- Cache Issue HOT 4
- Sub-dropdown HOT 3
- Error while setting setting's key & value HOT 6
- Install using composer HOT 2
- composer packages explication / question HOT 2
- Screenshots HOT 25
- Datatable HOT 1
- Starter Public Edition 5 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from starter-public-edition-4.