Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8641773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:36:57+00:00 2026-06-12T11:36:57+00:00

I am porting a PHP application from a ‘own’ ‘framework’ to Zend Framework (1.11.11)

  • 0

I am porting a PHP application from a ‘own’ ‘framework’ to Zend Framework (1.11.11) together with Doctrine2. This all wents well except that the application is available in two languages, Dutch and German. I am looking for a way to make two URL’s accesable:

I tried this with the Regex route but it isn’t nice since now the ‘page’ parameter must always being given when assembling:

resources.router.routes.viewreviews.type = "Zend_Controller_Router_Route_Regex"
resources.router.routes.viewreviews.route = "(klantbeoordelingen|kundenbewertung)[/]?([0-9]*)"
resources.router.routes.viewreviews.reverse = "%s/%d"
resources.router.routes.viewreviews.defaults.module = "default"
resources.router.routes.viewreviews.defaults.controller = "review"
resources.router.routes.viewreviews.defaults.action = "index"
resources.router.routes.viewreviews.map.name = 1
resources.router.routes.viewreviews.map.page = 2

The point is that it needs to be possible I should onmit the page param which now is impossible. I could make two regex routes though but that wouldn’t be a nice approach. Cause I would get A LOT of routes which all of them almost look the same.

I think I am not looking for chained routes since the language is not included in the URL. The language is defined by the domainname you are accesing (.nl or .de).

Are there any ideas? Tips?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:36:58+00:00Added an answer on June 12, 2026 at 11:36 am

    After some research there is a solution. What I did is the following:

    • I rewrote my routes in a routes.xml file. Example:

      <viewreviews>
          <type>BestBuy_Router_Route</type>
          <route>@klantbeoordelingen/:page</route>
          <translate>klantbeoordelingen</translate>
          <defaults>
              <module>default</module>
              <controller>review</controller>
              <action>index</action>
              <page>0</page>
          </defaults>
      </viewreviews>
      

    Note the @ in the route configuration. This will cause it to be translated. Then I add a meangless (for ZF) tag ‘translate’ so it will be picked up by Poedit.

    • The I edit my .po file and do the following in poedit: poedit and xml files

    • Then I crawl my XML file with poedit and It will find the tags and will question you to translate them.

    • After you translated these you make sure the correct translator is set in your router. I do this in my routeStartup cycle in a own written frontcontroller plugin:

          Zend_Controller_Router_Route::setDefaultLocale($translate->getLocale());
          Zend_Controller_Router_Route::setDefaultTranslator($translate);
      

    $translate is a Zend_Translate object.

    This should work for you. Translated routes only works with Zend_Controller_Router_Route. I extended this class and improved (BestBuy_Router_Route) cause I wanted all routes to be assembled lower cased etc.

    Cheers!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently porting a pretty basic gallery application from PHP to Go. This application
Porting an application from C# (1.1 framework) to VB.NET (3.5 framework), and I have
I am porting an application from Java Servlet to PHP. What's the equivalent of
So I am porting a VBA application to PHP and ran into this wonderful
I'm using the PHP SDK from facebook in my application. When I'm publishing a
I have been porting an application at work from the old Bing API to
I am planning on porting a PHP application over to Python. The application is
When posting from JS, PHP (5.3.8) returns some line returns in excess. For example:
I have a web page coded in PHP. This page is for posting a
I am having problems posting this multi checkbox data with ajax. <?php foreach($_SESSION['contacts'] as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.