# python: declare_var URL: https://generaltranslation.com/en-US/docs/python/api/declare-var.mdx --- title: declare_var description: API reference for the declare_var function --- ## Overview `declare_var` wraps a dynamic value with a GT variable marker so that translation engines can preserve the variable in translated output. ```python from gt_flask import declare_var # or from gt_fastapi import declare_var greeting = declare_var("Alice", name="user") ``` ## Reference ### Parameters ### Returns `str` — an ICU select construct that wraps the value as a GT variable marker. --- ## Notes - Use `declare_var` for values that change at runtime (e.g., user names, counts). - See also [`declare_static`](/docs/python/api/declare-static) for values known at build time. - Use [`decode_vars`](/docs/python/api/decode-vars) to extract the variables back from a marked string.