ObjFW  Check-in [defee30139]

Overview
Comment:OFLocalization: Prevent calling -[init] twice
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: defee30139dde39ce7f711beb3ee874e1bb0e5c92a796f98a085e77c6fdf20ee
User & Date: js on 2018-03-09 22:53:06
Other Links: manifest | tags
Context
2018-03-10
19:05
Add OFColor check-in: f484fedee2 user: js tags: trunk
2018-03-09
22:53
OFLocalization: Prevent calling -[init] twice check-in: defee30139 user: js tags: trunk
2018-02-27
20:36
OFHTTP{Client,Server}: Rename body to requestBody check-in: d375061886 user: js tags: trunk
Changes

Modified src/OFLocalization.m from [961ffbf68a] to [50c7e0128e].

20
21
22
23
24
25
26

27
28
29
30
31
32
33
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34







+







#include <locale.h>

#import "OFLocalization.h"
#import "OFString.h"
#import "OFArray.h"
#import "OFDictionary.h"

#import "OFInitializationFailedException.h"
#import "OFInvalidArgumentException.h"
#import "OFInvalidEncodingException.h"
#import "OFOpenItemFailedException.h"

#ifdef OF_MORPHOS
# define BOOL EXEC_BOOL
# include <proto/dos.h>
124
125
126
127
128
129
130




131
132
133
134
135
136
137
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142







+
+
+
+







{
	self = [super init];

	@try {
#ifndef OF_MORPHOS
		char *locale, *messagesLocale = NULL;

		if (sharedLocalization != nil)
			@throw [OFInitializationFailedException
			    exceptionWithClass: [OFLocalization class]];

		_encoding = OF_STRING_ENCODING_UTF_8;
		_decimalPoint = @".";
		_localizedStrings = [[OFMutableArray alloc] init];

		if ((locale = setlocale(LC_ALL, "")) != NULL)
			_decimalPoint = [[OFString alloc]
			    initWithCString: localeconv()->decimal_point