---
title: "Text Lookup Interface"
source: https://github.com/obs-rust/obs-studio/blob/524486a44c81ef30b039f10ab955bc778f39e225/docs/sphinx/reference-libobs-util-text-lookup.rst
commit: 524486a44c81ef30b039f10ab955bc778f39e225
tier: reference
tokens_est: 365
---
# Text Lookup Interface

Used for storing and looking up localized strings.  Uses an ini-file
like file format for localization lookup.


`text_lookup`


`struct text_lookup lookup_t`

.. code:: cpp

   #include <util/text-lookup.h>


## Text Lookup Functions


`lookup_t *text_lookup_create(const char *path)`

   Creates a text lookup object from a text lookup file.

   :param path: Path to the localization file
   :return:     New lookup object, or *NULL* if an error occurred



`bool text_lookup_add(lookup_t *lookup, const char *path)`

   Adds text lookup from a text lookup file and replaces any values.
   For example, you would load a default fallback language such as
   english with `text_lookup_create()`, and then call this
   function to load the actual desired language in case the desired
   language isn't fully translated.

   :param lookup: Lookup object
   :param path:   Path to the localization file
   :return:       *true* if successful, *false* otherwise



`void text_lookup_destroy(lookup_t *lookup)`

   Destroys a text lookup object.

   :param lookup: Lookup object



`bool text_lookup_getstr(lookup_t *lookup, const char *lookup_val, const char **out)`

   Gets a localized text string.

   :param lookup:     Lookup object
   :param lookup_val: Value to look up
   :param out:        Pointer that receives the translated string
                      pointer
   :return:           *true* if the value exists, *false* otherwise
