How to do translations in WordPress?

I’d recommend you using Loco Translate plugin to create a translation.
If you are creating a theme, you should specify the Text Domain and Domain Path in your style.css file.

/*
Theme Name: My Theme Name
Author: My Name
Author URI: http://sample.url
Description: Your theme description
Version: 1.0.0
Text Domain: mydomain
Domain Path: /lang
*/

Next, add some text in your theme.

<?php echo __( 'Hello there', 'mydomain' ); ?>

Then go to your wp-admin and you should find Hello there text and translate it to any languages you wish.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)