GithubHelp home page GithubHelp logo

Comments (9)

quasiperfect avatar quasiperfect commented on June 16, 2024

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.

ivantcholakov avatar ivantcholakov commented on June 16, 2024

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.

quasiperfect avatar quasiperfect commented on June 16, 2024

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.

ivantcholakov avatar ivantcholakov commented on June 16, 2024

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.

quasiperfect avatar quasiperfect commented on June 16, 2024

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.

ivantcholakov avatar ivantcholakov commented on June 16, 2024

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.

quasiperfect avatar quasiperfect commented on June 16, 2024

ok thanks a lot and sorry to be a bore

from starter-public-edition-4.

ivantcholakov avatar ivantcholakov commented on June 16, 2024

No problem at all.

from starter-public-edition-4.

ivantcholakov avatar ivantcholakov commented on June 16, 2024

@quasiperfect
I reworked internationalization totally, I think, its quality is good now.

from starter-public-edition-4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.