Sdry, I have wanted to do exactly this ever since Custom Settings came out. The problem, though, is that there is no Apex API for Custom Labels (click the link to vote for the idea for it!), so Custom Labels cannot be dynamically retrieved or requested within Apex. However, it CAN, as of Spring 12, be done in Visualforce, using Dynamic Components.
Here, I think is what you are looking for in Apex (that cannot yet be done):
Custom Settings + Custom Labels IN APEX (**not yet possible**)
// Get the stored Custom Setting record for User Preferences
User_Prefs__c p = User_Prefs__c.getInstance(UserInfo.getUserId());
// Get the stored ISO Code
String isoCode = p.ISO_Code__c;
// Get the running user's language
String languageKey = [
select LanguageLocaleKey from User
where Id = :UserInfo.getUserId()
limit 1
].LanguageLocaleKey;
// Get the translation of the ISO Code corresponding to this user's language
// **THIS IS NOT POSSIBLE YET IN APEX**
String translatedCode = System.Label.getLabel('ISOCode_'+isoCode).getTranslation(languageKey);
And here would be an equivalent if you are using Visualforce:
Custom Settings + Custom Labels IN VISUALFORCE (possible right now)
/* APEX CONTROLLER */
public class Controller {
public String getStoredISOCode() {
// Get the stored Custom Setting record for User Preferences,
// and return the ISO code
return User_Prefs__c.getInstance(UserInfo.getUserId()).ISO_Code__c;
}
}
/* VF PAGE */
<apex:page controller="MyController">
<b>ISO Code</b>{!storedISOCode}
<b>Translated</b>{!$Label['ISOCode_' & storedISOCode]}
</apex:page>
The system.schedule argument to represent the Date and time of the job is a bit quirky at first, but once you get the hang of it, its really quite simple
To answer you immediate question
Weekly (Here it is set up to run every Saturday at 8am, but you can adjust which day of the week by changing the 6th element, which happens to be a 6 for Saturday)
String sch = '0 0 8 * * 6'
Every 15 Days (Here I have the job running on the 1st and 15th of each month)
String sch = '0 0 00 1,15 * ?'
Monthly (This runs at 8 am on the last day of the month)
string sch = '0 0 8 L * ?'
Take a look at the docs here
http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_scheduler.htm
Have a similar question I answered here for a different time period, but same general concept
Apex cron job command to schedule an apex job to run every 4 hours daily
Best Answer
You can access these custom labels like this:
Do make sure that the names of the custom labels are correct.
For more information, see: https://help.salesforce.com/HTViewHelpDoc?id=cl_about.htm&language=en_US