OPTASY: Drupal Web Development Agency Toronto
(416) 243-2431Drupal SupportRequest A QuoteQuote

Main navigation

  • Home
  • Services
    • Digital Strategy
    • Design
    • Web Development
      • Drupal
      • WordPress
      • Magento
      • Laravel
      • Shopify
      • Sharepoint
      • Contentful
      • Gatsby
      • Next.js
      • Node.js
      • React
      • AngularJS
    • Mobile & App
      • IOS
      • Android
      • Augmented Reality
      • Artificial Intelligence
      • Virtual Reality
    • Maintenance & Support
      • Drupal Maintenance
      • Wordpress Maintenance
    • Staff Augmentation
  • Portfolio
    • Web
    • Mobile
    • Ar
  • About
    • Who we are
    • Values
    • Events
    • Awards
    • News
    • Careers
    • Partners
      • Acquia
      • Google
      • Pantheon
      • Shopify
      • Wordpress
  • Blog
    • Drupal
    • Drupal 8
    • HTML
    • CSS
    • Javascript
    • PHP
    • Microsoft
    • Web Design
    • Design
    • Tips
    • News
  • Contact
(416) 243-2431 Drupal Support Request A QuoteQuote

In light of the recent COVID-19 pandemic - OPTASY would like to offer DRUPAL website support for any Healthcare, Government, Education and Non-Profit Organization(s) with critical crisis communication websites or organizations directly providing relief. Stay Safe and Stay Well.

3 Ways to Translate Language Strings in Drupal 
Drupal

3 Ways to Translate Language Strings in Drupal 

by Adrian Ababei on Jul 07 2017

Does anyone of the following scenarios sound familiar to you?

 

  1. you need to translate a few language strings on your Drupal site due to a certain dialect that the great majority of your site visitors use    

     
  2. you simply prefer to see certain messages or labels on your website written slightly differently (let's assume that you prefer the “Add new content” textline to the “Add Content now” default one)

     
  3. you need to go multilingual (on your Drupal site at least) and you have a whole heavy load of language strings to be translated into those target languages

     

What do you do? Which are your options? Which one guarantees you a streamlined translation process? And most importantly: which one makes the perfect fit for your own site-specific scenario?

Let us try and answer all your questions by presenting you 3 approaches to language string translation in Drupal:

 

1. Use the String Override Module

Now before we go on with our short step-by-step guide on how to install and to turn this module into your handy translation tool, we feel like pointing out its “limitation”. It makes a more than handy tool mostly for all those small changes that you need to apply to just a few strings on your Drupal site.

Therefore, using it for a full-site translation “marathon” is probably not the most inspired choice.

This being said, let's break down further with our step-by-step installation and configuration guide:

Step 1: Download and Install Your Module

You'll find it here: https://goo.gl/aCJGyy you've successfully downloaded it, go to “Modules” > “Add New” > use your “Browse” and search for the file you need to upload > “Install”

Translate Language Strings in Drupal: download and install the overrides module

Next just briefly “scan” the enabled boxes corresponding to your two String Overrides fields there and, if everything looks OK to you, hit the “Save configuration” button!

 

Step 2: Trigger Your Module from the Configuration Menu

Now navigate to “Configuration” (you'll find it “neighboring” the “People” and the “Modules” tabs on top of the page) and, unfolding its menu, go to “Translate Interface”. It's the last option listed there (after the “Regional and Language” one).

Next just give it a click!

Step 3: Now Go Ahead and Replace Your Language String

Translate Language Strings in Drupal: replace your language string

Just enter the exact string that you want to replace/translate on the left side of your screen (in the “Original” section) and its replacement string/its translated version on the right side (in the “Replacement” section).

Easy peasy! And where do you add that the module even enables you to streamline things even more: you even get to replace multiple language strings simultaneously just by adding some extra rows. 

Wrap Up: as already mentioned, the String Overrides module makes a great choice for “small-scale” string translations only. It enables you to track down the strings you need to change and to replace them with the new ones in no time. Yet, when it comes to translating an entire Drupal site, manually overriding every single language string using this module is hardly an effective solution. Such a “challenge” to respond to calls for a more powerful module such as the Locale module.

2. Use the String Translation Module for Handling User-Defined Strings

Also known as the i18n_string module (falling under the Internationalization project's “umbrella).

Now if the just mentioned Locale module (along with the .po files) enables you to translate hard-coded language strings, the String Translation module empowers you to translate the user-defined ones, too.

And here we're referring to taxonomy terms, menu items, field names, which are a bit “trickier” when it comes to translating them, since you can't just rely on Drupal 7 core for that.

Also, another important specification that we need to make is that this is an API module! Therefore, it doesn't work as a standalone solution, but rather “supports” other modules from the Internationalization group.

And when it comes to the UI that you get to use to translate language strings in Drupal using this particular module, you should know that it's incorporated in the localization system: go to Administer > Site building > Translate interface for translating your user-defined language strings.

"And how does it work exactly?" you might legitimately ask yourself.

Here's how:

  • it uses the Locale's module standard translation page (the above mentioned UI) for enabling you to translate the user-defined strings that it will have collected 

     
  • but not before you haven't defined your site's default language (and it's not always English)

     
  • and it does this by grouping strings into “text groups” (you can find these groups of user-defined strings named “Profile”, "Menus” or “Taxonomy”, at admin/build/translate/search, under the "Limit search to:")

     

Translate Language Strings in Drupal: translate interface

Notes:

 

  • do keep in mind that whenever you're translating your user-defined strings, the source strings that will get stored will be displayed in your default language 

     
  • in case the default language on your website is not English, you still get to import/export English translations relying on your localization UI

     
  • a sort of “warning”: whenever you change the default language on your website you'll need to remember to redefine all your source language strings, too (the user-defined ones, of course)

     
  • in short: get yourself informed of all the implications deriving from changing your default language, since this goes hand it hand with a never-ending string editing “ordeal”, too

     
  • all the other translations on your website will be kept “unharmed”

     
  • yet, as a rule of thumb, you should be changing (if it's necessary) the default language on your site at the very beginning of its development process; later on, once you have your site up and running, changing it back and forth and in several different languages will only lead to... “language string chaos”

     

3. Use the Strings Overrides in Settings.php to Translate Language Strings in Drupal

You'll get to carry out the entire process in the settings.php file and where do you add that you don't even need to download, install and configure any extra module: it all happens in Drupal core.

Yet, you should be fully aware that it's not a method for the inexperienced either. We're not going to hide it from you: it does require a certain level of coding “expertise”.

Moreover, the same specification that we've made for the String Override module applies to this method, too: it's a tool to be used for small-scale string translations.

Not the best choice when you're faced with much larger-scale translations!

And now, shall we proceed with our explanations on “how it's done”?

1. Edit your settings.php file and go right up to line 430 (or somewhere 'around” it)

2. Next, uncomment this code (so that you can later on enter your translated strings)

 

434 # $conf['locale_custom_strings_en'][''] = array(

435 #   'forum'      => 'Discussion board',

436 #   '@count min' => '@count minutes',

437 # );

 

Note: in case the default language on your Drupal site is not English, remember to make the due modifications in the array key locale locale_custom_string_en so that it should reflect the actual language on your website!

Now let's assume that you're being “dared” to translate a whole lot of language strings on your website.Then you sure need to streamline things a bit, right?

For this you can rely on the i18n_string module, the API String Translation Module that we've just put into the spotlight. 

Just edit your settings.php file by entering this new line of code:

$conf['i18n_string_translate_langcode_en'] = TRUE;

Or, if you're not that much into “tweaking” code in settings.php you can always rely on the variable_admin module (part of the Variable module). Here's how you get to leverage its functionality to translate language strings in Drupal:

 

  1. first you navigate to admin/config/system/variable

     
  2. next you click on the "Multilingual settings" tab

     
  3. then on the "Enable translation for language" tab

     
  4. set your default language

     
  5. hit the “Save” button

     

And voila! Now you get to translate your language strings!

How about you? Have you, by any chance, discovered other more effective ways to translate language strings in Drupal?  

 

Share the article

Development

We do Web development

Go to our Web development page!

Visit page!

Do you want a website

or app developed?

 

Get a Free Quote

and let's make it work!

Get a Quote

Recommended Stories

DrupalTips
Why You Need Drupal Maintenance Services in 2023

Why You Need Drupal Maintenance Services in 2023

  Entering the world of Drupal web development can feel like diving into the unknown for many business owners. Once they've figured it out with the help of a developer or a Drupal development agency, the business runs smoothly for a little while.  However, building and optimizing a website is like buying a new house—it's functional at first, but things break down and need repairing and regular care in time.  Since spring is just over the corner, what better moment to start cleaning, improving, optimizing, and refreshing your website? Whether you do it in-house or hire an agency that offers Drupal maintenance services, it will work wonders and could actually double your potential market value. But first, it's essential to understand why a regular maintenance plan is critical, how to tell when you need Drupal Maintenance, and what does Drupal maintenance include. This article will answer these questions.   Why you should stick to a regular Drupal maintenance plan  If you've already entered the world of digital marketing, you know that the journey towards attracting and retaining customers doesn't end with web development and deployment. Change is a permanent constant in life, and businesses have to adapt to this ever-changing dynamic.  Security  A few years ago, website maintenance was optional. Building a static website that you could leave unattended for the entire year was perfectly normal.  Today, as the digital landscape has expanded and become more prone to security vulnerabilities, Drupal support is imperative for maintaining a healthy security posture.  Although Drupal is known for being the most secure CMS, this only applies if your Drupal website is regularly optimized with security updates and patches. The Drupal community and Drupal security team continuously build security patches, fixes, and upgrades, and Drupal users need to be in the loop about these updates. In other words, keeping up with the news and module updates in Drupal security is vital in order to avoid breaches.  Constant Drupal core module updates can boost website protection and secure it against cyberattacks and threats.  Fixing errors To ensure that your website performs well and meets the needs for speed and agility that the modern digital user demands, fixing bugs and errors is a top priority. These malfunctions may happen for multiple reasons—rushed coding and deployment, inadequate testing, or miscommunication. They may affect your site's performance and loading speed or even alter your Drupal website’s functionality.  And since users don't want to spend more than four seconds waiting for websites to load, not paying attention to repairing bugs could cost you customers.  This price is too big to pay, and it's worth considering Drupal maintenance services as part of your website strategies.  Keep your content fresh with new features Another reason why Drupal maintenance matters is related to scalability. Drupal websites can grow together with your business goals. Constant feature and module updates allow Drupal users a high level of customizing capabilities that helps businesses keep up with the changing needs of the customer.  With Drupal 8, integration is much more affordable, so if you haven't migrated yet, you might want to contact a Drupal agency to help you decide whether an upgrade is the right choice for your business.  The user behavior has dramatically shifted in the last year, which is why content optimization, new features, and enhancements allow brands to stay fresh and align to this changing environment.  SEO optimization Ranking high on Google and other search engines is crucial for your website to stay relevant. An excellent Drupal maintenance team has SEO experts that provide Drupal SEO audits and optimization.  “Good SEO work only gets better over time. It’s only search engine tricks that need to keep changing when the ranking algorithms change.” – Jill Whalen   How to tell when you need Drupal maintenance If you're not yet convinced that you need Drupal support and maintenance services for your website, here are some indicators that you can't postpone it any longer without hurting your business: Your website is slow, and you have received complaints about its loading speed. Your web traffic has dropped considerably. You experience more security breaches. Your content and design are outdated. Links, buttons, or forms are not working.   These are some of the red flags of poorly maintained websites. If you recognize these warning signs as part of your website, it's definitely time to start planning your maintenance strategy. What do Drupal maintenance services and support include? A useful maintenance model covers: Security and module updates Third-party integration support Regression testing  Bug diagnosing, fixing, and testing Hosting infrastructure maintenance Hack, malware, down recovery   Partner with the right Drupal maintenance and support agency When thinking about hiring a Drupal maintenance team, you need to consider your needs. At Optasy, we cover a wide range of website maintenance requirements and can create a customized maintenance and support plan to support your website's specific needs.  How does this sound to you? Have you made up your mind whether it is worth investing in Drupal maintenance services or not? If yes, then contact a reliable, dedicated support partner like Optasy and see how our Drupal maintenance services and Magento development maintenance support services can keep your website up and running.  Photo credit: geralt on Pixabay.     ... Read more
Raluca Olariu / Jun 07'2023
DrupalTips
Key Steps to Migrating from WebSphere to Drupal10

Key Steps to Migrating from WebSphere to Drupal10

  As technology continues to evolve, businesses are constantly seeking more efficient and flexible solutions for their web platforms. One popular migration path is transitioning from WebSphere to modern CMS platforms like Drupal 9 or 10. Drupal, renowned for its robust features and flexibility, offers a powerful and scalable framework for building dynamic websites and applications. In this article, we will explore the key steps involved in successfully migrating from WebSphere to Drupal10. Step 1: Evaluate and Plan Before embarking on any migration project, it is essential to conduct a thorough evaluation of your existing WebSphere system. This evaluation should identify the specific features, functionalities, and content that need to be migrated to Drupal. Take note of customizations, themes, modules, and any third-party integrations that are currently in place. Once the evaluation is complete, develop a comprehensive migration plan. Identify the goals and objectives of the migration, set realistic timelines, and allocate appropriate resources. Creating a prioritized list of tasks and determining the necessary budget for the migration process is also important at this stage. Step 2: Content Analysis and Migration One of the critical aspects of migration is content analysis. Evaluate the content structure in your WebSphere system and map it to the Drupal data model. Determine how your existing content types, taxonomies, and hierarchies can be translated into Drupal's entities, vocabularies, and menus. Next, extract the content from your WebSphere system using various migration tools or custom scripts. Transform the content into a format compatible with Drupal's structure and import it into your Drupal site. Ensure that all metadata, images, and other associated assets are correctly migrated and linked to the respective content items. Step 3: Design and Theming During migration, take the opportunity to refresh the look and feel of your website by leveraging Drupal's powerful theming capabilities. Identify the existing themes in your WebSphere system and recreate them in Drupal using the appropriate theming framework, such as Drupal's default theme engine or popular base themes like Bootstrap. Customize and fine-tune the theme to match your brand identity, ensuring consistency and responsiveness across different devices and screen sizes. Implement any required design modifications, such as layouts, typography, color schemes, and navigation menus, while adhering to Drupal's best practices. Step 4: Functionality and Module Integration WebSphere often includes custom functionalities and integrations that need to be migrated to Drupal. Analyze the existing modules and extensions in your WebSphere system and explore Drupal's extensive module ecosystem to find suitable alternatives or custom development options. Identify Drupal modules that offer similar functionalities to the ones used in WebSphere. Install and configure these modules in your Drupal environment, ensuring they meet your requirements. If no direct replacements are available, consider developing custom modules or engaging Drupal development experts to assist in replicating specific functionalities. Step 5: User Training and Testing Migrating to a new CMS requires training your content authors, editors, and administrators to ensure a smooth transition. Familiarize them with Drupal's interface, content management workflows, and administrative tasks. Provide comprehensive documentation and conduct training sessions to ensure your team is proficient in using Drupal. Conduct extensive testing throughout the migration process to identify and rectify any issues. Test the migrated content, functionalities, forms, and integrations to ensure they function as expected. Perform user acceptance testing (UAT) to obtain feedback from key stakeholders and make necessary adjustments before going live. Step 6: Go Live and Post-Migration Support Once all testing and refinement processes are complete, it's time to deploy your Drupal site and make it live. Coordinate with your IT team or hosting provider to ensure a seamless transition. Optasy is a leading Drupal development agency that specializes in assisting companies with seamless and successful Drupal migrations. With our extensive expertise and experience in Drupal, we offer comprehensive migration services tailored to meet the unique needs of each organization. Our team of skilled professionals meticulously evaluates the existing systems, designs a strategic migration plan, and executes the migration process with precision and efficiency. Optasy ensures a smooth transition from legacy systems like WebSphere to the latest versions of Drupal, including Drupal 9 and 10. We provide end-to-end support, from content analysis and data migration to theme customization, module integration, and post-migration support. Contact us for more information.   Photo credit: Pixabay.... Read more
Raluca Olariu / May 24'2023
Drupal
Everything You Should Know About Drupal for Enterprise

Everything You Should Know About Drupal for Enterprise

  Drupal is a free and open-source content management system, and one of the most popular CMSs used by big companies in North America. It has been around since 2004 and it’s still growing fast. Drupal is an excellent digital solution if you want to build a website that can grow with your business. Drupal enterprise is built on top of Drupal core, which means that all features are available in both versions. The difference between them is that the enterprise version comes with additional modules and themes. If you need more functionality than what is included in the standard version, then you should consider using the enterprise version. If you want to use Drupal for big companies, then you should look into the enterprise version. This allows you to create a custom theme or module for your company logo, colors, etc.         Why CTOs of Big Companies Choose Drupal? Drupal has been adopted by some of the biggest names in technology. Here are just a few examples: Yahoo! - Yahoo uses Drupal to deliver its email service, Flickr photo-sharing service, and many other products. The New York Times - The New York Times uses Drupal to publish its news stories online. Facebook - Facebook uses Drupal to manage its social network. Twitter - Twitter uses Drupal to manage its microblogging service. LinkedIn - LinkedIn uses Drupal to manage its professional networking service.  Salesforce - Salesforce uses Drupal to run its CRM product. Why are these big companies choosing Drupal? Let's look at some of the top benefits of Drupal for enterprises.   Key Benefits of Drupal Enterprise When used for big companies, Drupal can provide competitive advantages like: Scalability and flexibility. Drupal Enterprise is highly scalable, allowing organizations to handle large volumes of content and high-traffic loads efficiently. Its modular architecture and flexible API enable seamless integration with existing systems and third-party applications, making it an ideal choice for enterprise-level projects. Robust content management. Drupal Enterprise provides a robust content management system (CMS) that empowers organizations to manage and publish content easily. It offers advanced content creation, editing, and publishing capabilities, supporting multiple content types and workflows. With its granular permission system, Drupal Enterprise ensures secure access and control over content management processes. Extensive module ecosystem. Drupal Enterprise benefits from an extensive module ecosystem, providing a wide range of pre-built modules and integrations. These modules allow organizations to add additional functionalities and features to their websites without the need for custom development, saving time and effort. Multisite and multilingual support. Drupal Enterprise excels in managing multisite architectures, enabling organizations to manage multiple websites from a single Drupal installation. This capability is particularly beneficial for businesses with diverse brands, regions, or departments. Additionally, Drupal Enterprise offers comprehensive multilingual support, allowing organizations to create and manage websites in multiple languages effectively. Security and reliability. Drupal Enterprise prioritizes security and has a strong track record in protecting websites against vulnerabilities and threats. The Drupal Security Team actively monitors and addresses security issues promptly, ensuring a secure environment for enterprise-level applications. Regular security updates and a dedicated community contribute to the ongoing reliability and stability of Drupal Enterprise. Customizability and extensibility. Drupal Enterprise provides extensive customization options, allowing organizations to tailor their websites to specific requirements. Its modular architecture and theming capabilities enable organizations to create unique and visually appealing websites. Additionally, Drupal's API-first approach facilitates integration with other systems, providing the flexibility to extend functionality as needed. Community support and collaboration. Drupal has a vibrant and active community of developers, designers, and users. Organizations using Drupal Enterprise benefit from the collective knowledge and expertise of this community. The community actively contributes to the platform's development, shares best practices, and provides support through forums, documentation, and events. Why the Drupal Enterprise Needs Acquia? If you're looking for an easy way to deploy a new project, Acquia offers a complete solution for managing all aspects of your Drupal deployment from planning through production. And if you need to add features or fix bugs, we have a team of experts ready to assist you. We are one of the most reliable Drupal service providers on the market and we want to ensure that you get the right support when you need it. That means providing you with everything you need to get started quickly and efficiently. Our expert consultants are always available to answer questions about how to get the most out of our solution.       How to Use Drupal Enterprise As an enterprise solution, you need to have a good understanding of how your business works, what problems you face, and how you want to solve them. You should also know how your organization uses IT resources, including people, time, money, and other resources. Before you start working with Acquia, you may want to talk with someone who has experience working with enterprises, such as a CIO, a Chief Marketing Officer, or another senior executive at your company. This person could serve as a mentor, helping you understand how to leverage Acquia to meet your needs. The following are some tips to consider when planning your deployment: Know your data. Before you deploy Drupal, you must first determine whether your data is stored locally or remotely. If your data is stored remotely, you might need to set up a secure connection between your local computer and the remote server where your data resides. Understand your budget. It's important to know how much money you're willing to spend before you buy Drupal. Depending on your current technology stack, you might be able to find free solutions. However, if you don't have a lot of money, you might need to evaluate alternative options. For example, you might choose to migrate your existing application to Drupal instead of buying new software. Know your timeline. When deciding how long it takes to implement a project, keep these factors in mind: Your team size (the larger your team, the longer it generally takes to complete a project), your skills (some projects take less time than others because they require fewer skills. For example, if you already have a custom database schema, you won't need to learn how to build one from scratch.), your expertise (some projects take less than others because you've done similar things before). Learn about Drupal. To ensure that you fully understand Drupal, you should read the documentation, attend training classes, and ask questions. You should also work closely with a Drupal expert during the implementation process. Is Drupal the Right Choice for Your Intranet? Drupal can help you create an engaging user experience by providing content that is relevant to users' interests. By using features like views, blocks, and dynamic menus, you can easily organize information into specific areas of your site. In addition, Drupal offers many modules that allow you to customize your site to fit your unique needs. If you’re looking for a platform to support your internal communications, then Drupal is a great option. With its robust feature set, Drupal provides a variety of tools to help you manage your content effectively. Whether you’re looking to provide employees with a way to share ideas internally, or you’re looking at ways to improve customer service, Drupal can help. Conclusion  The key to choosing the right CMS for your organization is understanding what you want out of your website and how your business will use it. This guide has provided some insight into each type of CMS so you can make an informed decision when selecting which solution best fits your needs and supports your open-source project. What are your experiences with different types of CMSs? Share them below!     Photo credit: Unsplash.... Read more
Raluca Olariu / May 24'2023

Browse cities

×

Toronto

WordPress Development Services in Toronto
iOS App Development Services in Toronto
Drupal Development Services in Toronto
Magento Development Services in Toronto
Laravel Development Services in Toronto

Montreal

WordPress Development Services in Montreal
iOS App Development Services in Montreal
Laravel Development Services in Montreal
Drupal Development Services in Montreal
Magento Development Services in Montreal

Vancouver

Magento Development Services in Vancouver
iOS App Development Services in Vancouver
Drupal Development Services in Vancouver
WordPress Development Services in Vancouver
Laravel Development Services in Vancouver

New York

WordPress Development Services in New York
Laravel Development Services in New York
iOS App Development Services in New York
Drupal Development Services in New York
Magento Development Services in New York

Need a new Project?

Dare us to shape and boost your idea(s)!

Start a Project

(416) 243-2431

Contact

(416) 243-2431

contact@optasy.com

Toronto Downtown

First Canadian Place,
100 King St. W. Suite 5700, Toronto

Toronto West

2275 Upper Middle
Rd. E, Suite 101
Toronto

New York

1177 Avenue of the
Americas, 5th Floor,
New York

Newsletter

Get the latest OPTASY news, tips and how-to’s on the go, right in your inbox!
OPTASY
clutch
Pantheon Premier Partner
  • Drupal 8
  • Services
  • Contact Us
  • Partners

  • Drupal
  • Google
  • Magento
  • Shopify
  • Wordpress
Facebook
Twitter
LinkedIn
Drupal
  • Cities
  • Support

© 2023 All Rights Reserved. Built with Drupal