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

  • Home
  • SEARCH
  • 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 8701083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:18:36+00:00 2026-06-13T02:18:36+00:00

My module works fine with ‘translator’ => array( ‘locale’ => ‘de_DE’, ‘translation_file_patterns’ => array(

  • 0

My module works fine with

'translator' => array(  'locale' => 'de_DE',
            'translation_file_patterns' => array(
                    array(
                    'type'     => 'gettext',
                    'base_dir' => __DIR__ . '/../language',
                    'pattern'  => '%s.mo',

Only when i use MO files like DE.mo EN.mo but when files are en_US.mo , de_DE.mo i need to add to congik 'text_domain' => __NAMESPACE__ , and in my view $this->translate('some message',__NAMESPACE__)
How i can escape this difference?

  • 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-13T02:18:38+00:00Added an answer on June 13, 2026 at 2:18 am

    You can use text domains, but they are not obligatory. So:

    'translator' => array('locale' => 'de_DE',
        'translation_file_patterns' => array(
            array(
                'type'     => 'gettext',
                'base_dir' => __DIR__ . '/../language',
                'pattern'  => '%s.mo',
            ),
        ),
    )
    

    And in your view script:

    <?php echo $this->translate('My Foo'); ?>
    

    If you use a text domain, then you must use them in both the configuration and the view helper:

    'translator' => array('locale' => 'de_DE',
        'translation_file_patterns' => array(
            array(
                'type'        => 'gettext',
                'base_dir'    => __DIR__ . '/../language',
                'pattern'     => '%s.mo',
                'text_domain' => 'domain-1'
            ),
        ),
    )
    

    Then you must do this:

    <?php 
        $this->plugin('translate')->setTranslatorTextDomain('domain-1');
        echo $this->translate('My Foo') 
    ?>
    

    But either way are possible. It is not the case you need to use text domains for specific locales.

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

Sidebar

Related Questions

I have a module that reads the StandardError of a process. Everything works fine,
I am using booking module in my Magento store. All works fine before a
My helper code looks like this (and works fine btw): module ProvidersHelper def call_to_review(provider)
I'm working with maven in a multi module project and it works fine. But
I have the following lua script : module(modoo,package.seeall) foo=1 bar={12,34} Which works fine using
I have made a custom module and it works fine till I start working
I have downloaded a module from a blog and it works fine. but i
I have an Apache HTTP server with mod_h264_streaming module installed. It works fine for
UPD: The code works just fine on a newer Redis module version: 1.904 vs
I have developed a module using SagePay Form integration method. It works fine until

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.