Ticket #5408: 5408.patch
File 5408.patch, 3.3 KB (added by , 14 years ago) |
---|
-
headers/os/locale/Catalog.h
1 /* 1 /* 2 2 * Copyright 2003-2009, Haiku, Inc. 3 3 * Distributed under the terms of the MIT License. 4 4 */ … … 83 83 #undef TR 84 84 #define TR(str) \ 85 85 be_catalog->GetString((str), TR_CONTEXT) 86 #define B_TRANSLATE(str) \ 87 be_catalog->GetString((str), TR_CONTEXT) 86 88 87 89 #undef TR_CMT 88 90 #define TR_CMT(str, cmt) \ 89 91 be_catalog->GetString((str), TR_CONTEXT, (cmt)) 92 #define B_TRANSLATE_CMT(str, cmt) \ 93 be_catalog->GetString((str), TR_CONTEXT, (cmt)) 90 94 91 95 #undef TR_ALL 92 96 #define TR_ALL(str, ctx, cmt) \ 93 97 be_catalog->GetString((str), (ctx), (cmt)) 98 #define B_TRANSLATE_ALL(str, ctx, cmt) \ 99 be_catalog->GetString((str), (ctx), (cmt)) 94 100 95 101 #undef TR_ID 96 102 #define TR_ID(id) \ 97 103 be_catalog->GetString((id)) 104 #define B_TRANSLATE_ID(id) \ 105 be_catalog->GetString((id)) 98 106 99 100 107 // Translation markers which can be used to mark static strings/IDs which 101 108 // are used as key for translation requests (at other places in the code): 102 109 /* example: … … 123 130 #undef TR_MARK 124 131 #define TR_MARK(str) \ 125 132 BCatalogAddOn::MarkForTranslation((str), TR_CONTEXT, "") 133 #define B_TRANSLATE_MARK(str) \ 134 BCatalogAddOn::MarkForTranslation((str), TR_CONTEXT, "") 126 135 127 136 #undef TR_MARK_CMT 128 137 #define TR_MARK_CMT(str, cmt) \ 129 138 BCatalogAddOn::MarkForTranslation((str), TR_CONTEXT, (cmt)) 139 #define B_TRANSLATE_CMT(str, cmt) \ 140 BCatalogAddOn::MarkForTranslation((str), TR_CONTEXT, (cmt)) 130 141 131 142 #undef TR_MARK_ALL 132 143 #define TR_MARK_ALL(str, ctx, cmt) \ 133 144 BCatalogAddOn::MarkForTranslation((str), (ctx), (cmt)) 145 #define B_TRANSLATE_ALL(str, ctx, cmt) \ 146 BCatalogAddOn::MarkForTranslation((str), (ctx), (cmt)) 134 147 135 148 #undef TR_MARK_ID 136 149 #define TR_MARK_ID(id) \ 137 150 BCatalogAddOn::MarkForTranslation((id)) 151 #define B_TRANSLATE_ID(id) \ 152 BCatalogAddOn::MarkForTranslation((id)) 138 153 139 154 #endif /* B_AVOID_TRANSLATION_MACROS */ 140 155 … … 170 185 const char *context = NULL, 171 186 const char *comment = NULL); 172 187 virtual status_t SetString(int32 id, const char *translated); 173 188 174 189 virtual bool CanWriteData() const; 175 190 virtual status_t SetData(const char *name, BMessage *msg); 176 191 virtual status_t SetData(uint32 id, BMessage *msg); 177 192 178 193 virtual status_t ReadFromFile(const char *path = NULL); 179 194 virtual status_t ReadFromAttribute(entry_ref *appOrAddOnRef); 180 195 virtual status_t ReadFromResource(entry_ref *appOrAddOnRef); 181 196 virtual status_t WriteToFile(const char *path = NULL); 182 197 virtual status_t WriteToAttribute(entry_ref *appOrAddOnRef); 183 198 virtual status_t WriteToResource(entry_ref *appOrAddOnRef); 184 199 185 200 virtual void MakeEmpty(); 186 201 virtual int32 CountItems() const; 187 202 … … 324 339 const char *context = NULL, 325 340 const char *comment = NULL); 326 341 status_t SetString(int32 id, const char *translated); 327 342 328 343 bool CanWriteData() const; 329 344 status_t SetData(const char *name, BMessage *msg); 330 345 status_t SetData(uint32 id, BMessage *msg); 331 346 332 347 status_t ReadFromFile(const char *path = NULL); 333 348 status_t ReadFromAttribute(entry_ref *appOrAddOnRef); 334 349 status_t ReadFromResource(entry_ref *appOrAddOnRef); 335 350 status_t WriteToFile(const char *path = NULL); 336 351 status_t WriteToAttribute(entry_ref *appOrAddOnRef); 337 352 status_t WriteToResource(entry_ref *appOrAddOnRef); 338 353 339 354 void MakeEmpty(); 340 355 341 356 private: