1/* 2 * Copyright 2013-2014, Stephan A��mus <superstippi@gmx.de>. 3 * Copyright 2013, Rene Gollent <rene@gollent.com>. 4 * Copyright 2016-2024, Andrew Lindesay <apl@lindesay.co.nz>. 5 * All rights reserved. Distributed under the terms of the MIT License. 6 */ 7 8 9#include "Language.h" 10 11 12Language::Language(const char* language, const BString& serverName, 13 bool isPopular) 14 : 15 BLanguage(language), 16 fServerName(serverName), 17 fIsPopular(isPopular) 18{ 19} 20 21 22Language::Language(const Language& other) 23 : 24 BLanguage(other.ID()), 25 fServerName(other.fServerName), 26 fIsPopular(other.fIsPopular) 27{ 28} 29 30 31status_t 32Language::GetName(BString& name, 33const BLanguage* displayLanguage) const 34{ 35 status_t result = BLanguage::GetName(name, displayLanguage); 36 37 if (result == B_OK && (name.IsEmpty() || name == Code())) 38 name.SetTo(fServerName); 39 40 return result; 41} 42