Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
cescofry committed Jun 28, 2013
1 parent 3ef404f commit c4d4fa9
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion Strings/ZFTranslationFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,16 @@ - (NSArray *)allLanguages {

#pragma mark - writing

/*!
@abstract
Generate the missing file URL extrapolated form the reference file
@param langFile the receiving file to be chnaged
@param referenceLangFile reference to generate the url
*/

- (void)convertURLForLanguage:(ZFLangFile *)langFile fromLangFile:(ZFLangFile *)referenceLangFile {
if (langFile.url) return;

Expand All @@ -229,6 +239,16 @@ - (void)convertURLForLanguage:(ZFLangFile *)langFile fromLangFile:(ZFLangFile *)
[[NSFileManager defaultManager] createDirectoryAtURL:[langFile.url URLByDeletingLastPathComponent] withIntermediateDirectories:YES attributes:nil error:&error];
}

/*!
@abstract
Takes all the translations and write the files accordingly to the driven option
@return BOOL if the process succeded or not
@discussion At the moment the process is only generating the non-driven file. However this is wrong. Because the list of transaltion is merged between iOS and Android, and the driven file would not receive the new keys.
*/

- (BOOL)writeAllTranslations {

if (self.conversionDriver == ZFTranslationFileConversionDriverSkip) return NO;
Expand Down Expand Up @@ -282,7 +302,19 @@ - (BOOL)writeAllTranslations {

#pragma mark - sorting


/*!
@abstract
sorted array of languages by type and language identifier
@param type to be searched. Must not be ignored
@param identifier to be searched. Can be nil
@return NSArray of translations
@discussion The tye argument is compulsory amd setting it to 0 will trigger iOS results. To be ammended in the future.
*/

- (NSArray *)translationsByType:(ZFLangType)type andLanguageIdentifier:(NSString *)identifier {
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"type = %d && language = %@", type, identifier];
Expand Down

0 comments on commit c4d4fa9

Please sign in to comment.