/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2003-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file Translation.h14/// @author Michael Behrisch15/// @date 2023-01-2416///17// Translation macros18/****************************************************************************/19#pragma once20#include <config.h>21#ifdef HAVE_INTL22#include <libintl.h>23#endif24#include "StringUtils.h"252627// ===========================================================================28// global definitions29// ===========================================================================30#ifdef HAVE_INTL31static inline const char*32my_pgettext(const char* msg_ctxt_id, const char* msgid) {33const char* translation = dcgettext(NULL, msg_ctxt_id, LC_MESSAGES);34if (translation == msg_ctxt_id) {35return msgid;36}37return translation;38}394041#define TL(string) gettext(string)42#define TLC(context, string) my_pgettext(context "\004" string, string)43#define TLF(string, ...) StringUtils::format(gettext(string), __VA_ARGS__)44#else45#define TL(string) (string)46#define TLC(context, string) (string)47#define TLF(string, ...) StringUtils::format(string, __VA_ARGS__)48#endif495051