Welcome to mirror list, hosted at ThFree Co, Russian Federation.

localization.mm « platform - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: da00397480d476d3b70e6ea67241a1abb51267b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "platform/localization.hpp"

#include <algorithm>

#import <Foundation/Foundation.h>

namespace platform
{
std::string GetLocalizedTypeName(std::string const & type)
{
  auto key = "type." + type;
  std::replace(key.begin(), key.end(), '-', '.');
  std::replace(key.begin(), key.end(), ':', '_');

  return [NSLocalizedString(@(key.c_str()), @"") UTF8String];
}

std::string GetLocalizedBrandName(std::string const & brand)
{
  auto const key = "brand." + brand;
  return [NSLocalizedString(@(key.c_str()), @"") UTF8String];
}

std::string GetLocalizedString(std::string const & key)
{
  return [NSLocalizedString(@(key.c_str()), @"") UTF8String];
}
}  // namespace platform