How to translate a WordPress.org plugin?

So to make plugin translatable via translate.wordpress.org you need to add text domain into main plugin’s file:

/*
 * Plugin Name: My Plugin
 * Author: Plugin Author
 * Text Domain: my-plugin
 */

So to make theme translatable via translate.wordpress.org you need to add text domain into main theme’s file:

/*
* Theme Name: My Theme
* Author: Theme Author
* Text Domain: my-theme
*/

And also all the strings should be wrapped with gettext _() functions with the same text domain.

All further details can be found in the official docs below: