Before you Start.
Revive Adserver, as a project, has been around for a very long time, and as a result, some of the language that you will find used the code base will often not align with the language used in the UI, as the terms used in online advertising have changed over the decades.
The following is list of historical terms that may be helpful to be aware of when reading code/comments in code.
|Current UI Terminology||Previous Terminology In Code|
|Delivery Rule Sets|
Coding Best Practices
When writing code that is executed as part of the process of delivering banners, it is important that warnings etc. that may be thrown by code are not displayed as output, as it is obviously not desirable to display these in the browser when displaying a banner. (Displaying warnings in the Revive Adserver UI is not ideal, but at least it will help users know what the problem is. Showing warnings about problems instead of a banner is very bad.)
Accordingly, if methods/functions called in delivery engine code could throw warnings etc., these should be suppressed / handled as appropriate, to ensure that they are not displayed to the UI.
The translation of localization strings for the user interface are managed through the Revive Adserver Crowdin project.
This means that if you think a translation used in the user interface for any language other than English is incorrect, please create an account with Crowdin, and suggest a new translation there. Accepted translations are periodically merged by the core Revive Adserver team into the master branch of Revive Adserver, and will be included in the next release.
However, if you think that:
- A master English translation needs to be changed (e.g. to reflect changed functionality);
- A new master English translation key needs to be added (e.g. to reflect new functionality); or
- A master English translation key needs to be removed (e.g. to reflect removed functionality)
then these changes should all be performed as a change in the master branch.
The changes to the master English files are automatically imported into the Crowdin project. Translations in languages other English will be automatically updated to reflect the added or out of date translations that need to be corrected, and to remove any keys no longer required.
Translation Strings in PHP Code
In PHP code, to obtain a correctly translated string for display to a user, based on their settings, use the
Translation Strings in Smarty Templates
In Smarty template code, to obtain a correctly translated string for display to a user, based on their settings, use the
Numeric, Date, and Time Formats in Code
In Revive Adserver, there are no options for users to define how they want number, date, and time values to be formatted. Instead, the formats for all of these are based on the language selected.
To format numbers, use the
To format dates and times, the strings defined in the
default.lang.php file should be used. For example, from the English translation file:
These strings should be used to format dates and times as appropriate. For example: