Lokalise enables you to perform the find and replace operation with ease. In this article you'll learn how to achieve that and what options you can adjust.

Please note that Find and replace feature is available to project admins only — regular contributors cannot perform this operation.

Index

Finding the values to replace

To replace some text with a new value, open your project editor and click the Replace button in the top right corner:

You will be presented with the following dialog:

  • From the All languages dropdown you can choose a specific language to search. This dropdown is available only when you're searching among translations — you cannot select a language when searching among key names or tags.

  • If the Match case option is enabled, the widget will search only for the words with exactly the same case as you specified. For example, if you've entered welcome then the word "welcome" will be returned as a result, but not "Welcome" or "weLComE".

  • Enter your search term in the first text input (in the example above we entered "welcome").

  • Enter a replacement value in the second text input (in the example above we entered "Good day").

  • You can search among translations, key names, and tags by switching between the three corresponding tabs.

After the search term is entered you'll be presented with a handful of results or "Nothing to show" message saying that the widget could not find anything based on your query.

When performing a search among translations, for each result you can see the following info:

  • The platform that the translation key is assigned to (in the example above both results are assigned to Web platform as indicated by a "Google Chrome" icon).

  • Translation key name (in the example above the names are static_pages:index:welcome and welcome_web).

  • Translation language (in the example above both translations are in US English).

  • The actual text highlighted with yellow background.

When searching for translation key names, the results will look a bit different:

For each result you can see:

  • The platform that the translation key is assigned to (in the example above we have two Web platforms and one iOS).

  • Translation key name (in the example above the names are static_pages:index:welcome, welcome_web, and welcome_ios).

When searching among tags, you'll see the following output:

In this case only the tag name is displayed.

Replacing with the new value

Now you'll need to choose the values to be replaced with a new one. To achieve that, tick the checkboxes next to the results. Alternatively, you can click Select all or Deselect all at the bottom of the dialog. Once you are ready, click Replace:

When you click the Replace button the following operations will be performed:

  • A project snapshot will be created automatically. If the replacement goes wrong, you will be able to restore the previous project version using this snapshot. To achieve that, open project settings, proceed to the Snapshots tab, find the desired snapshot and click Restore. Please note that the current project will be left intact, and the project copy will be created instead.

  • If you were performing a translation replacement, your translation memory will be updated accordingly with the new value.

  • The actual replacement will be performed.

Search without replacement

If you would like to find a value in the project editor but not replace it, use the Search box in the top right corner:

Enter a search term, enable or disable the Case sensitive option, wait for a couple of seconds and observe the results. To clear the search box, click on the X icon.

The search will be performed across keys and values.

The found matches will be highlighted with yellow background. You can manage the found items as usual.

Did this answer your question?